realpath returns empty string

Jordy picture Jordy · Oct 26, 2011 · Viewed 13.3k times · Source

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

Alexey Morozov picture Alexey Morozov · Oct 26, 2011

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.