In the perpetual pursuit of security, I've been applying an open_basedir restriction to my Debian hosting with PHP 5.2.6.
I'm sometimes getting errors like: File(/var/www/remos/access-logs) is not within the allowed path(s): (/var/www)
Or if the open_basedir is changed to have a slash on the end: File(/var/www/remos/access-logs) is not within the allowed path(s): (/var/www/)
To me, it looks as if the file is eminently within the allowed path.
The actual line in php.ini is: open_basedir = /var/www/ (with or without trailing slash)
Further thought about the specific errors suggests that what is really happening is that operations such as is_writeable() or is_link() on directories that are not accessible to the user running the PHP script result in these errors. Can anyone confirm this?
If this is so, it raises a supplementary question. Is there a way to safely test whether a directory is inaccessible without raising an error?