Solved

Apache Mac Case Sensitivity

Posted on 2009-07-03
7
565 Views
Last Modified: 2012-05-07
I have a Mac running Apache (Default Zend Server Setup) and a AptanaCloud Site (*NIX virtual host).

I thought all Unix based systems were case sensitive, however my Mac doesn't seam to mind on PHP includes but Aptana does. This is quite  bore as I when I move my projects from the local server to remote they often don't work because of folder names.

I use the Zend_Autoloader to load my external PHP classes which uses the pattern Folder/Folder/Class.php for Folder_Folder_Class... However there are some custom paths like a folder called models takes classes mapped as Model_. So sometimes the folder has to be lower case and sometimes upper depending on whether it is registered in the Autoloader.
0
Comment
Question by:stmayes
  • 3
  • 3
7 Comments
 
LVL 1

Accepted Solution

by:
scott_whitlow earned 500 total points
ID: 24776232
Yes, Mac's are not case sensitive. If you make a directory called "test" and then immediately try and make a directory called "TEST" it will give you an error.

You probably want to come up with a naming convention for your folders and files anyway. This is just good programming practice.

This is a good place to start:
http://en.wikipedia.org/wiki/Identifier_naming_convention
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 24777955
OS X 10.x uses case sensitive HFS by default, unless you changed it due to re-installation or use of disk system utility.
If you changed it to case-insensitive there is no way for any program to use case-sensitive files or directories. You need to ensure unique names youself.
0
 

Author Comment

by:stmayes
ID: 24781787
My file system seams to be case-sensitive but Apache doesn't.

Re: naming convention, I do have a convention in place but my Zend Autoloader is trying to be too helpful by allowing me to put this like Module_Form_Class in a folder called module/forms/Class.php.. (note the plural folder name). For folders not registered in the Autoloader I have to use the same as the class name eg. Module_Connector_Class is mapped to Module_Connector_Class...

My problem is that Apache finds the files/ folders regardless of case, whereas my server is a little more picky.

Can anyone help me find an option to make Apache more strict???
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 24782914
do you use mod_spelling? check your config files for CheckSpelling directive
or do you have RewriteRule which match case insensitive
0
 

Author Comment

by:stmayes
ID: 24782957
No rewrite rule. Just checked all config files. No reference to Mod_Spelling or CheckSpelling... Thanks for the tip though...
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 24783194
case sensitive filesystem, and no case sensitive configuration for apache; that sound strange, very strange.
Are you really talking about URLs handled by apache? and not URLs handled by a module (like php, perl, mod_jk, ...)
0
 

Author Comment

by:stmayes
ID: 24840173
I fairly certain it's Apache. I'm using Zend_Application_Module_Autoloader (from the Zend Framework) to do my PHP includes. I guess it could be PHP. The two PHP versions are identical as is the source code. The only difference is Mac and Linux.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question