The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP Selector & OPCache

Discussion in 'CloudLinux' started by TCB13, Mar 3, 2015.

  1. TCB13

    TCB13 Well-Known Member

    Joined:
    Jul 25, 2014
    Messages:
    58
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm running a server with cPanel/WHM + CloudLinux and I recently tried to deploy the PHP Selector functionality, however I've an issue with Zend OPcache. The server was running Zend OPcache without CageFS and PHP Selector just fine.

    I installed Zend OPcache by:

    Code:
    1. Create the file, /var/cpanel/easy/apache/rawopts/all_php5, that contains the following text: --enable-opcache
    
    2. Run EasyApache
    
    3. Enable and configure OPcache by adding the following at /usr/local/lib/php.ini:
    
    zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20121212/opcache.so
    opcache.enable=1
    opcache.enable_cli=1
    opcache.memory_consumption=128
    opcache.interned_strings_buffer=8
    opcache.max_accelerated_files=50000
    opcache.revalidate_freq=60
    opcache.fast_shutdown=1
    opcache.save_comments=1
    opcache.use_cwd = 1
    opcache.validate_timestamps = 1
    opcache.enable_file_override = 0
    
    4. Restart apache
    
    As you can see zend_extension is set as /usr/local/lib/php/extensions/no-debug-non-zts-20121212/opcache.so. This config worked just fine.

    After installing CloudLinux's PHP Selector, my previous configuration works fine if I set the account to use the native PHP version, however after enabling a PHP Selector version like 5.6, OPcache wasn't loaded.

    I find out that I needed to add the PHP options also to the PHP versions used by the PHP Selector, so I decided to edit /etc/cl.selector/global_php.ini and add:

    After this I set the PHP version on an account to PHP 5.6 and OPcache worked, same to the other versions:

    Captura de ecrã 2015-03-3, às 20.59.03.png

    However if I go to WHM > LVE Manager > Selector, I get this errors on all versions different from 5.5 or native:

    Captura de ecrã 2015-03-3, às 21.01.53.png

    I guess my OPcache extension is a version that isn't completely compatible with PHP different from 5.5, however, even if I set an account to PHP 5.6 at phpinfo() OPcache seems to be working and caching files.

    I tried to change the extension path to:

    The errors at LVE Manager disappeared. PHP 5.5 and 5.6 show a "zend_opcache" module. 5.4 shows no_such_file_or_directory.

    It looks fine, however, PHP 5.5 and 5.6 at phpinfo() report OPCache as disabled... Even when my global global_php.ini settings say otherwise:

    Captura de ecrã 2015-03-3, às 21.08.04.png

    How can I fix this mess? I'm kinda lost here. Thank you ;)
     
    #1 TCB13, Mar 3, 2015
    Last edited: Mar 3, 2015
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. TCB13

    TCB13 Well-Known Member

    Joined:
    Jul 25, 2014
    Messages:
    58
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    So, since every PHP version has it's own opcache file at /opt/alt/phpXX/etc/php.d.all/opcache.ini I decided to remove from my global /etc/cl.selector/global_php.ini the zend_extension directive, making every version load its own proper extension.

    This should work right? The opcache runs fine on all versions, however at the LVE Manager I still get the same issue. All versions different from 5.5 complain about zend_opcache_requires_zend_engine_api_version_220121212.

    Is this normal?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  5. TCB13

    TCB13 Well-Known Member

    Joined:
    Jul 25, 2014
    Messages:
    58
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Sure, I'll. Thank you ;)
     
  6. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    TCB13 what did you find on this?
     
Loading...

Share This Page