I'm new to PHP but have a very frustrating, seemingly simple problem
echo realpath("../../Database/mydb.mdb");
Works perfectly on a live server but returns blank on localhost!
I may be barking up the wrong tree , but is it a PHP setting in IIS I'm missing ?
localhost running PHP 5.6.31 and IIS 10
From here- realpath()
returns FALSE on failure, e.g. if the file does not exist.
So it seems in your localhost, you may not have the file structure as you said.
From the same source : The running script must have executable permissions on all directories in the hierarchy, otherwise realpath()
will return FALSE.
So, also make sure that there is no permission issue.
EDIT: From here: The function realpath() will not work for a file which is inside a Phar as such path would be a virual path, not a real one.
That is realpath(..)
won't work for any virtual directory, it will work only if the path is real i.e. not virtual.