waving android

I am currently a software engineer at Google, where as a member of the Android platform team I build frameworks and user interfaces.

The blog here at is mostly historical; you can find more recent posts on .

Stupid PHP.

November 19th, 2002

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.

newer: older: