Jordy Jordy - 7 months ago 17
PHP Question

realpath returns empty string

I use MediaWiki but there is an error. I found it in the files. There is line with this code:

$IP = realpath( '.' );


But $IP returns an empty string, so the path to the files in the system is not working. (for example if $IP would be
.
or
E:/path_to_wwwroot
it works). How can I solve the problem. Is it possible that my provider blocked access to realpath?

Thanks!

Answer

Source: http://php.net/manual/en/function.realpath.php

Note: The running script must have executable permissions on all directories in the hierarchy, otherwise realpath() will return FALSE.

So your web server should have access also to pre-webroot directories.

Comments