eAccelerator and open_basedir: open_basedir restriction in effect. File() is not within the allowed path(s):

After installing eAccelerator on a CentOS 5.5 server running PHP 5.2.10, a bunch of websites began failing with open_basedir errors like so:

[Fri Jul 16 17:53:50 2010] [error] [client XX.XX.XXX.XXX] PHP Warning: require() [function.require]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/username/) in /home/username/public_html/wp-settings.php on line 19, referer: http://www.server.com/

After doing some research it turns out that a default option that is compiled into eAccelerator is incompatible with open_basedir. The fix is easy enough, simply re-compile with the –without-eaccelerator-use-inode option like so:

make clean
phpize
./configure --without-eaccelerator-use-inode
make
make install

After re-compiling and installing, make sure you clear out the existing eAccelerator files before restarting Apache:

rm -rf /var/cache/eaccelerator/*
apachectl restart

eAccelerator states that the next version will have this compile option set by default.

Reference:

One response to “eAccelerator and open_basedir: open_basedir restriction in effect. File() is not within the allowed path(s):”

  1. Alex says:

    Thanks for this.
    It totally works!