So I've been developing on windows. Today i moved my files to a linux based webhost. i notice that :
require_once dirpath(__FILE__) . DIRECTORY_SEPARATOR . "foo.php"`
is failing with the file not found error.
I can see that the file is present where it is expected to be.
Are there some known problems of this nature?
Edit 1:
I suspected it might be because of linux being a case sensitive environ. I converted all my camel cased file names to lower case. I'm still having the problem. Unfortunately, my host doesn't allow remote telnet access. I can only use cpanel. Are there any other suggestions.
Edit 2:
It turned out to be an issue with the case sensitivity of file names. Beats me why cpanel was displaying them in the correct case which led to the confusion on my side. I had to convert names to use all lower case, then uploaded into server and things were fine. Git did give me a lot of problems when I tried to change just the case in the filename, but that's a story for another day.
If you moved from Windows to Linux there is one Issue in the File System:
Linux is CASE SENSITIVE!
that means: "foo.php" and "Foo.php" on Windows are exactly the Same file, but on Linux they aren't. If you've got "Foo.php" you wont find it by searching for "foo.php".
Echo out your dirpath(__FILE__) . DIRECTORY_SEPARATOR . "foo.php"
so you are 100% sure that its the correct dir. I am willing to bet it isn't...
Otherwise it is a permission issue you would have to double check.
Can you ls -al
the directory foo.php is in, you might have incorrect file permissions.