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

March 6, 2011

This blog post should guard other admins from searching for hours about following error message:


require(): open_basedir restriction in effect. File() is not within the allowed path(s): (/var/www/domains/xxxxxxxx/html/:/var/www/xxxxxxxx/include/:/var/www/domains/xxxxxxxx/tmp/)
in '/var/www/domains/xxxxxxxx/html/core/Translate.php' at the line 81


#0 Piwik_ErrorHandler(2, require(): open_basedir restriction in effect. File() is not within the allowed path(s): (/var/www/domains/xxxxxxxx/html/:/var/www/xxxxxxxx/include/:/var/www/domains/xxxxxxxx/tmp/), /var/www/domains/xxxxxxxx/html/core/Translate.php, 81, Array ([language] => en,[path] => /var/www/domains/xxxxxxxx/html/lang/en.php)) called at [/var/www/domains/xxxxxxxx/html/core/Translate.php:81]
#1 Piwik_Translate::loadTranslation() called at [/var/www/domains/xxxxxxxx/html/core/Translate.php:81]
#2 Piwik_Translate->loadTranslation(en) called at [/var/www/domains/xxxxxxxx/html/core/Translate.php:35]
#3 Piwik_Translate->loadEnglishTranslation() called at [/var/www/domains/xxxxxxxx/html/core/FrontController.php:197]
#4 Piwik_FrontController->init() called at [/var/www/domains/xxxxxxxx/html/index.php:56]

I got it when I tried to install Piwik. I tried everything including setting setting open_basedir to /. It stopped working if I activated the basedir protection and started working if I removed it. After hours searching I found it. I looked into the wrong direction – the problem was not php but eAccelerator. After I found that out it was easy to get to the solution, you need to compile it with the option --without-eaccelerator-use-inode, e.g.this way:


VERSION=0.9.6.1
URL=http://bart.eaccelerator.net/source/$VERSION/eaccelerator-$VERSION.tar.bz2


cd /tmp/
rm -rf eaccelerator-$VERSION
wget $URL
tar xvjf eaccelerator-$VERSION.tar.bz2
cd eaccelerator-$VERSION
phpize
./configure --enable-eaccelerator=shared --without-eaccelerator-use-inode
make
make install

4 Comments »

RSS feed for comments on this post. TrackBack URI

  1. No, I do not work (eAccelerator – 0.9.6.1)
    helped this one:

    Solves this bug fix one line of code in the source eAccelerator – eaccelerator.c, line 867:

    if (php_check_open_basedir (realfilename TSRMLS_CC)) {

    on

    if (php_check_open_basedir (p-> realfilename TSRMLS_CC)) {

    After all re-compile eAccelerator, reinstall it.

    Comment by Crazy Demon — March 11, 2011 #

  2. Robert, thanks! Indeed, you cut the amount of time I spent looking for a fix down to about 20 minutes.

    This worked perfectly for me.

    Comment by Ivan Novak — July 13, 2011 #

  3. […] Note: In case you run into difficulties with basedir-open/basedir-restrictions you might want to have a look at these 2 links: http://robert.penz.name/334/eaccelerator-and-the-open_basedir-restriction-in-effect-file-is-not-with… […]

    Pingback by Installing eAccelerator for PHP in Debian Squeeze » IT Tips and Tricks — December 20, 2012 #

  4. […] on Internet I found those sites where they also ghad the same problem … and had solved it. http://robert.penz.name/334/eaccelerator-and-the-open_basedir-restriction-in-effect-file-is-not-with… Same here: […]

    Pingback by PHP problem of ‘basedir-open’ » IT Tips and Tricks — December 21, 2012 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Powered by WordPress
Entries and comments feeds. Valid XHTML and CSS. 36 queries. 0.053 seconds.