I have an application which has such a piece of code inside:
if (!file_exists("some_file.php"))
{
echo "Something wrong...";
}
So it just checks if some_file.php is uploaded to the same directory where application is installed. I've been using it for 12+ months on different and everything was fine. Yesterday one of customers reported that application doesn't work.
I checked it, and application could not find this file (but file EXISTS!) on customer's server. Then I did another check - wrote a line of code:
$file=fopen("whatever.txt", "w");
Surprise surprise, file "whatever.txt" was not found by application again, even if it was uploaded to same directory. My application works fine on hundreds of different servers, and this is the 1st time when customer has issues. Server is powered by freebsd and uses DirectAdmin.
Personally I guess it's related to include_path settings in php.ini file, but may be I'm wrong? What may cause this problem and how could I force application to open file from existing directory?
I know I could write full path like
$file=fopen("/home/some_username/public_html/some/directory/whatever.txt", "w");
but this is not a solution.
I'm waiting for ANY ideas and suggestions.
Thanks!