Apache Mac Case Sensitivity

Posted on 2009-07-03
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 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:
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???
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Wordpress and Wufoo 1 39
pass foreach data in php into jquery ajax 10 50
Php - How to get the value of json file using PHP? 29 58
PHP Underscores vs. Directory separators 5 28
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

733 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