[solved] ZendOptimizerPlus

Discussion in 'Install/Configuration' started by riotera, Jun 8, 2013.

  1. riotera

    riotera Member

    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: Jun 23, 2013
  2. tomksoft

    tomksoft Member

    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)
    wget https://github.com/eaccelerator/eaccelerator/tarball/master
    mv master eaccelerator.tgz
    tar xvf eaccelerator.tgz
    cd eaccelerator-eaccelerator-42067ac
    ./configure --with-php-config=/usr/local/lsws/lsphp5/bin/php-config
    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. riotera

    riotera Member

    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.
  4. NiteWave

    NiteWave Administrator

    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
  5. riotera

    riotera Member

    I built ZendOptimizerPlus in the same way, I see the extension in phphinfo() but it doesn't work. See the picture in attachment.

    Attached Files:

  6. NiteWave

    NiteWave Administrator

    I reproduced the issue just now. it hardcode sapi in ZendAccelerator.c:
       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:
       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.
  7. riotera

    riotera Member

    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.
  8. Frankk912

    Frankk912 Member

    It appears to be working fine for me with LSAPI 6.2. Thank you!

    Edit: After adding "litespeed" to the list **

Share This Page