View Full Version : eaccelerator installation
surfman
12-29-2006, 05:49 PM
I am with PHP 4.4.4, when I run
/admin/misc/enable_phpa.sh
choose 3 to enable eaccelerator, nothing happened. when I enter php -v
it shows:
Copyright (c) 1997-2006 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with Zend Extension Manager v1.0.9, Copyright (c) 2003-2006, by Zend Technologies
with Zend Optimizer v2.6.2, Copyright (c) 1998-2006, by Zend Technologies
nothing about eaacelerator. any suggestion? I am under Cpanel. thanks.
surfman
12-29-2006, 07:07 PM
I also noticed the version under SSH command line is showing
PHP 4.4.2 (cli) (built: May 10 2006 12:17:27)
not PHP 4.4.4
But when I check vbulletin PHP_Info page, it is 4.4.4
any idea? thanks.
mistwang
12-29-2006, 08:44 PM
command line php is from the Linux distribution, lsphp bundled in LSWS package is 4.4.4 .
You can use APC instead of eaccelerator which included in the package. you may need to build your own php and eaccelerator.
surfman
12-30-2006, 04:48 PM
is there anything shown different after I sucessfully install APC or Eaccelerator? I try choose 1 or 3, nothing changes when I check phpinfo page.
My server has two CPU, there something says APC will not work at more than one CPU when I run
/admin/misc/enable_phpa.sh
is that true?
or, if I re-compile the whole new PHP 4.4.4, how can I replace it with the pre-built PHP under LSWS? thanks.
surfman
12-30-2006, 06:13 PM
when I use
/opt/lsws/fcgi-bin/lsphp -i
it will show
phpinfo()
PHP Version => 4.4.4
System => Linux web.chinasmile.net 2.6.19.0.dn.am #1 SMP Mon Dec 4 20:46:04 EST 2006 i686
Build Date => Aug 23 2006 21:31:15
Configure Command => './configure' '--with-litespeed' '--with-config-file-path=../conf' '--with-zlib' '--with-zlib-dir=..' '--with-gd' '--with-jpeg-dir=..' '--with-png-dir=..' '--enable-shmop' '--enable-track-vars' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-magic-quotes'
Server API => LiteSpeed
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /opt/lsws/conf/php.ini
PHP API => 20020918
PHP Extension => 20020429
Zend Extension => 20050606
Debug Build => no
Zend Memory Manager => enabled
Thread Safety => disabled
Registered PHP Streams => php, http, ftp, compress.zlib
This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with eAccelerator v0.9.3, Copyright (c) 2004-2005 eAccelerator, by eAccelerator
and
eAccelerator
eAccelerator support => enabled
Version => 0.9.3
Caching Enabled => true
Optimizer Enabled => false
Memory Size => 16,777,176 Bytes
Memory Available => 16,775,080 Bytes
Memory Allocated => 2,096 Bytes
Cached Scripts => 0
Removed Scripts => 0
Cached Keys => 0
Directive => Local Value => Master Value
eaccelerator.cache_dir => /tmp/eaccelerator => /tmp/eaccelerator
eaccelerator.check_mtime => 1 => 1
eaccelerator.compress => 1 => 1
eaccelerator.compress_level => 9 => 9
eaccelerator.content => shm_and_disk => shm_and_disk
eaccelerator.debug => 0 => 0
eaccelerator.enable => 1 => 1
eaccelerator.filter => no value => no value
eaccelerator.keys => shm_and_disk => shm_and_disk
eaccelerator.name_space => no value => no value
eaccelerator.optimizer => 0 => 0
eaccelerator.sessions => shm_and_disk => shm_and_disk
eaccelerator.shm_max => 0 => 0
eaccelerator.shm_only => 0 => 0
eaccelerator.shm_prune_period => 0 => 0
eaccelerator.shm_size => 16 => 16
eaccelerator.shm_ttl => 0 => 0
Obviously eaccelerator is enabled. but it seems does not work. when I check
phpinfo.php
at broswer, I will see nothing about eaccelerator although showing php 4.4.4 that is pre-built php in litespeed.
anyway for eaccelerator to work without re-compile PHP? thanks.
mistwang
12-30-2006, 08:37 PM
Earlier version of APC has issue with SMP server, should have been fixed in current release.
It is strange that it works on command line, but not from within web server.
Please double check the phpinfo.php output, see if php configuration file /opt/lsws/conf/php.ini has been used. it might be a permission issue with the php.ini.
surfman
12-30-2006, 08:44 PM
may I know the permission for /opt/lsws/conf/php.ini ? 644 or 755?
mistwang
12-30-2006, 09:21 PM
644 is fine. the problem probably is the permission of /opt/lsws/conf directory, for security reason, it is set to 0700, it not recommended to set it to 0755.
When lsphp started in suexec mode, it is more likely that lsphp is not allowed to read /opt/lsws/conf/php.ini.
You can change the lsphp command to use php.ini at a different location. copy php.ini to /opt/lsws/conf/php/php.ini. change command to "$SERVER/fcgi-bin/lsphp -c /opt/lsws/conf/php/php.ini", make sure permission for /opt/lsws/conf/php has been set to 0755.
surfman
12-31-2006, 08:15 AM
as a test, I set /opt/lsws/conf 755, then, eaccelerator is working.
but when I follow your instruction,
1) copy php.ini to /opt/lsws/conf/php/php.ini
2) change command to "$SERVER_ROOT/fcgi-bin/lsphp -c /opt/lsws/conf/php/php.ini at LSAPI App settings in admin control panel
3) also, I modify
zend_extension="../lib/eaccelerator.so"
to
zend_extension="/opt/lsws/lib/eaccelerator.so"
4) set back /opt/lsws/conf 700
5) set /opt/lsws/conf/php 755
eaccelerator stops working.
any suggestion for extra steps? thanks.