msgbartop
MAC OS X, Linux, Windows and other IT Tips and Tricks
msgbarbottom

21 Dec 12 PHP problem of ‘basedir-open’

After having upgraded Apache, PHP and other PHP modules I found out that we had problems with errors regarding restrictions of opening files within the set htdocs directory. I found that out by enabling error messages to be shown in the php.ini file. After researches on Internet I found those sites where they also had the same problem … and had solved it.
//robert.penz.name/334/eaccelerator-and-the-open_basedir-restriction-in-effect-file-is-not-within-the-allowed-paths-problem/
Same here:
//www.tequilafish.com/2010/07/22/eaccelerator-and-open_basedir-open_basedir-restriction-in-effect-file-is-not-within-the-allowed-paths/

So based on these sites(thanks to both authors) I wrote this short how-to.
Note: In the comments of ‘//robert.penz.name….’ someone wrote that the solution didn’t work and as an alternative proposed to make a small change in the code of the file eaccelerator.c.
Well first, the special configure option DOES resolve the problem (at least in version 0.9.6.1),
second, his solution of changing the code produces a compilation error, so that doesn’t work.

The problem doesn’t always occur. The reason is that as soon as a php file has been changed the eAccelerator notices it and doesn’t fetch the result from the cache but get it fresh from Apache which this time doesn’t create this error. But the second time and all other times after, which makes eAccelerator fetch the content from cache, the error occurs.
Solution: Recompile eAccelerator with the special configure option: –without-eaccelerator-use-inode
tar xvjf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1
phpize
./configure --enable-eaccelerator=shared --without-eaccelerator-use-inode
make
make install

– clear the eAccelerator cache and restart Apache

The rest of the details you can get from the installation instructions of eAccelerator in this site (//tipstricks.itmatrix.eu/?p=931)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: