I\'m developing a PHP program on MAMP, and just realized the following screwy behavior:
echo \"
PATH = \".dirname(__FILE__);
include \'include.php\
I was using apache and I found that the __DIR__ of the executed file was the same one found in the DOCUMENT_ROOT of the apache config.
That means that if the apache config had
DocumentRoot /users/me/stuff/my_site
script from the question was printing:
PATH = /users/me/stuff/my_site (All lower case)
PATH = /Users/me/stuff/my_site (Mixed case)
And if the apache config had:
DocumentRoot /Users/me/stuff/my_site
script from the question was printing:
PATH = /Users/me/stuff/my_site (Mixed case)
PATH = /Users/me/stuff/my_site (Mixed case)
Which was much better.
If you encounter this problem, check the apache configuration taking into account that it's case sensitive.