Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Apache Mac Case Sensitivity

Posted on 2009-07-03
Medium Priority
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.
Question by:stmayes
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3

Accepted Solution

scott_whitlow earned 2000 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:
LVL 51

Expert Comment

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.

Author Comment

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???
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

LVL 51

Expert Comment

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

Author Comment

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

Expert Comment

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, ...)

Author Comment

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.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…
Suggested Courses

604 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