[Resolved] ZendOptimizerPlus

Status
Not open for further replies.
#1
I tried to install the opcode cache ZendOptimizerPlus (https://github.com/zendtech/ZendOptimizerPlus) extension on my Litespeed server 4.2.3 with PHP 5.4.15 but in phpinfo I get this:

Startup Failed
Opcode Caching is only supported in Apache, ISAPI, FPM and FastCGI SAPIs
Does it means it is not compatible with Litespeed?

APC doesn't work well with php 5.4 and ZendOptimizerPlus seems to be main new opcode cache project.
 
Last edited by a moderator:
#2
I am not sure about ZendOptimizerPlus, but you could try latest eAccelerator(warning: seems like the eAccelerator you can tick in LiteSpeed web console when compiling PHP is old!).
I am using eAccelerator with PHP 5.4.15 without any issues.

Here's the way I set it up(nonopensource LiteSpeed installed with default settings)
Code:
wget https://github.com/eaccelerator/eaccelerator/tarball/master
mv master eaccelerator.tgz
tar xvf eaccelerator.tgz
cd eaccelerator-eaccelerator-42067ac
/usr/local/lsws/lsphp5/bin/phpize
./configure --with-php-config=/usr/local/lsws/lsphp5/bin/php-config
make
make install

echo "extension=\"eaccelerator.so\"">>/usr/local/lib/php.ini
echo "eaccelerator.shm_size=\"16\"">>/usr/local/lib/php.ini
echo "eaccelerator.cache_dir=\"/dev/shm/eaccelerator\"">>/usr/local/lib/php.ini
echo "eaccelerator.enable=\"1\"">>/usr/local/lib/php.ini
echo "eaccelerator.optimizer=\"1\"">>/usr/local/lib/php.ini
echo "eaccelerator.check_mtime=\"1\"">>/usr/local/lib/php.ini
echo "eaccelerator.debug=\"0\"">>/usr/local/lib/php.ini
echo "eaccelerator.filter=\"\"">>/usr/local/lib/php.ini
echo "eaccelerator.shm_ttl=\"0\"">>/usr/local/lib/php.ini
echo "eaccelerator.shm_prune_period=\"0\"">>/usr/local/lib/php.ini
echo "eaccelerator.shm_only=\"0\"">>/usr/local/lib/php.ini
 
#3
Thanks @tomksoft! If it is working for you I try to install it on my server too.

In any case it would be important to know if it is or will be possible install ZendOptimizerPlus on Litespeed.
 

NiteWave

Administrator
#4
we have not tested ZendOptimizerPlus yet, but should work if it works with apache.

the build steps is exactly same as tomksoft did for eAccelerator
 

NiteWave

Administrator
#6
I reproduced the issue just now. it hardcode sapi in ZendAccelerator.c:
Code:
   2363         static const char *supported_sapis[] = {
   2364                 "apache",
   2365                 "fastcgi",
   2366                 "cli-server",
   2367                 "cgi-fcgi",
   2368                 "fpm-fcgi",
   2369                 "isapi",
   2370                 "apache2filter",
   2371                 "apache2handler",
   2372                 NULL
   2373         };
I added "litespeed" to the list:
Code:
   2363         static const char *supported_sapis[] = {
   2364                 "apache",
   2365                 "litespeed",
   2366                 "fastcgi",
make and make install, phpinfo() now shows:
Zend OPcache
Opcode Caching: Up and Running
Optimization: Enabled
Startup: OK
..
refresh phpinfo a few times:
Cache hits 9
Cache misses 1

looks working fine.
 
Last edited by a moderator:
#7
Great NiteWave! I've edited ZendAccelerator.c as you suggested and it is working for me too.

Do you think that just adding litespeed to the list is enough to get the extension working correctly?

Thanks for your help.
 
Last edited by a moderator:
Status
Not open for further replies.
Top