eAccelerator | openbase_dir error ?

RDWest2005

Verified User
Joined
May 7, 2008
Messages
14
Hello guys,
I decided to install eAccelerator in my servers running DA to help speedup article directories I have with close to 200,000 articles...

I did the install from the howto in here but i have an error with openbase_dir.

I'm running CentOS 5.4 x86_64
I installed the defaults of custombuild
I think it is php cli

If I turn off openbase dir, it seems to be fine and shows up in phpinfo like it should.

But it gives error with openbase dir on.
Anyone have an idea how to fix this?
Thanks,
RD
 
Instead of turning it off, how about leaving the restriction on, but adding the required directories to the list of those directories allowed.

Jeff
 
same here.

PHP Warning: Unknown: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/xxxx/:/tmp:/var/tmp:/usr/local/lib/php/) in Unknown on line 0
PHP Fatal error: Can't load /home/xxxx/domains/xxxx.com/public_html/index.php, open_basedir restriction. in Unknown on line 0


Added:
open_basedir = /home/xxxx/:/tmp:/var/tmp:/usr/local/lib/php/

still got those errors.
 
same here.

PHP Warning: Unknown: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/xxxx/:/tmp:/var/tmp:/usr/local/lib/php/) in Unknown on line 0
PHP Fatal error: Can't load /home/xxxx/domains/xxxx.com/public_html/index.php, open_basedir restriction. in Unknown on line 0


Added:
open_basedir = /home/xxxx/:/tmp:/var/tmp:/usr/local/lib/php/

still got those errors.

php 5.3.1, eaccelerator-0.9.6-rc1 works fine.
php 5.3.1, eaccelerator-0.9.6-rc2 error.
php 5.3.1, eaccelerator-0.9.6 error
 
I came across this error too, so here is the fix for the people who dont know what to do.

Edit this file.
Code:
nano /usr/local/updatescript/eaccelerator-0.9.6/eaccelerator.c

Find

Code:
if (PG(open_basedir) && php_check_open_basedir(realname TSRMLS_CC)) {

Replace with

Code:
if (PG(open_basedir) && php_check_open_basedir(file_handle->filename TSRMLS_CC)) {

recompile and restart httpd, then you are allowed to enable open base dir.
 
Hi

I upgrade to php 5.3.8, because I understand, there is no problem with eaccelerator and open_base_dir problems.

But I have.

I turn OFF Open BaseDir for my domains. So ok, I have no problem.

But it is not what I want to do.

I try to compile, but without success.

Before I replace bad line by :
Code:
 if (PG(open_basedir) && php_check_open_basedir(file_handle->filename TSRMLS_CC)) {

I do this :
Code:
cd eaccelerator-0.9.6.1 ; 
export PHP_PREFIX="/usr/local" ; 
$PHP_PREFIX/bin/phpize
rm -fr /usr/local/lib/php/extensions/no-debug-non-zts-*/eaccelerator.so;
./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config --with-eaccelerator-content-caching ; make ; make install;
cd /tmp ; rm -fr /tmp/eaccelerator ; mkdir eaccelerator ; chmod 0777 eaccelerator ; 
cd /usr/local/updatescript;
echo "eAccelerator install/update done" ; exit;

But I have an error after
./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config --with-eaccelerator-content-caching ;

It is just write : error 1

Do you have an idea about the problem ?
Have you another solution ?
 
I try again and message after make is

Code:
/usr/local/updatescript/eaccelerator-0.9.6.1/eaccelerator.c: In function 'eaccelerator_restore':
/usr/local/updatescript/eaccelerator-0.9.6.1/eaccelerator.c:868: erreur: 'file_handle' undeclared (first use in this function)
/usr/local/updatescript/eaccelerator-0.9.6.1/eaccelerator.c:868: erreur: (Each undeclared identifier is reported only once
/usr/local/updatescript/eaccelerator-0.9.6.1/eaccelerator.c:868: erreur: for each function it appears in.)
make: *** [eaccelerator.lo] Erreur 1
 
I'm stupid !! Sorry

PG(open_basedir) does not exist in eaccelerator.c in 0.9.6.1
So now, you have to do :

Edit this file /usr/local/updatescript/eaccelerator-0.9.6/eaccelerator.c

Find

Code:
if (php_check_open_basedir(realname TSRMLS_CC)) {

Replace with

Code:
if (php_check_open_basedir(file_handle->filename TSRMLS_CC)) {

And now, I can recompile without error.
Now it works with or without open base dir
 
Works, but very strange.
Only files from forum are stored in cache.

Before, it was files of the site, which are used very often.

Files of forum have hits at 0.
Some files of site have more than 300 000 hits in 10 minutes.

I do not understand what happens.

So, I compile a new time, with update.script, and turn off openbase_dir
It works again as before, and cached files of the site.

It is not a problem on this server to turn off openbasedir, but I want to use eaccelerator on another servers, and I can't turn off openbasedir

So, have you an idea, or better, a solution ?
 
Last edited:
Ok, solution is a little different :

Edit this file /usr/local/updatescript/eaccelerator-0.9.6/eaccelerator.c

Find

Code:
if (php_check_open_basedir(realname TSRMLS_CC)) {

Replace with

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

And now, I can recompile without error.
Now it works with or without open base dir
 
try to recompile EA with option
--without-eaccelerator-use-inode

i haven't any problem with EA and enabled openbase_dir
 
Hi,

I try with this option --without-eaccelerator-use-inode
But nothing change, it is same effect. I also read this on different posts.
 
Back
Top