0

This example works fine on my localhost (both files are included), but on my server only the second one is:

<?php
include('Test.php');
echo '<br/>';
include('test.php');
?>

The only difference is the caps on the second include, so I was trying to figure out how to make the caps not matter.

Robbie
  • 700
  • 2
  • 6
  • 18
  • 1
    possible duplicate of [PHP case sensitive path's issue](http://stackoverflow.com/questions/7948453/php-case-sensitive-paths-issue) – sourabh devpura Jun 22 '15 at 03:33
  • I suspect your local test environment is Windows, which is case-insensitive to files names. While production is Linux which is case-sensitive. You could have both Test.php and test.php in the same directory and the OS would consider them different files. There's no way around it. That should not be issue though. Not knowing the case of your includes is just sloppy coding. – martynasma Jun 22 '15 at 03:56

1 Answers1

4

Your local host must be Windows, that doesn't differentiate between upper and lower case in file names and your web server Unix Based which does, simple as that.

Hanky Panky
  • 46,730
  • 8
  • 72
  • 95
  • 2
    *nix does it right; windows does it wrong: simple as that :-) –  Jun 22 '15 at 03:34
  • And there isn't any kind of workaround. Because REALLY going to suck have to find all the different cased files. – Robbie Jun 22 '15 at 03:34
  • 2
    @Robbie consider it a valuable lesson along your programming journey –  Jun 22 '15 at 03:35
  • It's not going to be as bad as you think Robbie, just run a glob on your directory and see the cases and use accordingly. Ideally you could make them all follow a standard naming convention. – Hanky Panky Jun 22 '15 at 03:36