2

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 under /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!

galchen
  • 5,252
  • 3
  • 29
  • 43
  • You should write up your answer below and then mark it as the correct one after the timeout. This will help people who encounter this problem in the future. – Gavin Anderegg Oct 16 '11 at 15:14
  • problem is - it's not really solved. using suPHP instead is not a solution. hopefully i'll have it really solved (under fastCGI) in a few days. currently i have open_basedir disabled on some of my websites. – galchen Oct 16 '11 at 15:17

1 Answers1

1

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.)

hynekcer
  • 14,942
  • 6
  • 61
  • 99