php open_basedir File() <- empty brackets
I have a server with ISPConfig3 installed, and I have a user with multiple websites and shared files.
I have a strange open_basedir
problem:
Trying to include: /var/www/clients/client2/web4/web/core/defs.php Warning: require(): open_basedir restriction in effect. File() is not within the allowed path(s): (/var/www/clients/client2/web4/web:/some more paths.....
As you can see, /var/www/clients/client2/web4/web/core/defs.php
is u开发者_如何学Gonder /var/www/clients/client2/web4/web
, which is in the open_basedir's allowed paths.
Any idea what it could be?
EDIT:
Ok, I found out that defs.php
is actually included properly. After it ends, I get the "File() is not within the allowed path(s)" errors:
Notice that File()
<- braces are empty.
I think it happens because of the require
/include
function maybe. I'm using fastCGI btw.
anybody seen this anywhere?
NOTE:
http://www.howtoforge.com/forums/showthread.php?t=51164
It does not appear under suPHP.
I found out that the problem is caused when using eAccelerator. switching to APC solve it!
It can be fixed by flushing the eAccelerator cache rm -rf /var/cache/php-eaccelerator/*
and reloading Apache.
If you extend open_basedir
due to previous too narrow path, the previous warnings stay incorrectly cached and reported again, although the code works correctly.
Other solution is to configure the web control panel /usr/share/doc/php-eaccelerator-..*/control.php and to set eaccelerator.allowed_admin_path
. Then Clear cache by browser and immediately reload Apache
On shared hostings it is a bigger problem. (because without flushing the cache the file being included stay there. Even disabling "open_basedir" does not prevent the warning. Also touching the file is not nice because a small edit like whitespace is not enough for re-caching and a backward edit returns the same problem.)
精彩评论