0

I have my development website on a mac, and php don't care with uppercase and lowercase. But when I set my website on production server (debian) I have problems because I forgot to set uppercase.

Is there a solution to set php on mac case sensitive ?

for exemple

$test = new test();

will work on dev but not on prod

Thanks

Ajouve
  • 9,735
  • 26
  • 90
  • 137

1 Answers1

4

This isn't a PHP behaviour, but you are likely to have an autoloader that loads the class definition when needed. Different from Windows and OS X' HFS*, Unix/Linux' filesystems are usually case sensitive. So while PHP doesn't care about the case of new test(), the autoloader can't find the right file on the case-sensitive Linux filesystem.

The only good solution really is to adjust the case so the autoloaded class name matches the file name.

* = HFS apparently has a switch that can make it case sensitive. But that won't help you in this situation.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • 2
    Note: switching to Mac OS Extended (Case-sensitive,Journaled) will cause some OS X applications to not work properly. – cmorrissey Nov 04 '13 at 21:22