Stupid PHP.
Stupid PHP.
If you’re trying to figure out why your webserver, running in safe mode and
with open_basedir restrictions, is generating an “open_basedir restriction in
effect” message when looking for a file in a directory you know should
be OK, it’s probably because the file does not exist.
Yeah, it seems to be a bug. The following file (basedir.php) explains it all:
<?
if (is_file(“/path/to/my/site/basedir.php”))
echo “basedir.php exists<br>”;
if (is_file(“/path/to/my/site/nonexistent.php”))
echo “nonexistent.php exists”;
?>
The first call will succeed, and the second will fail (it should), but it will
also emit a warning. It shouldn’t. PHP is stupid. Replace the call to
is_file with @is_file; PHP will suppress the warning but
return the correct result. Yuck.