TCB13

Well-Known Member
Jul 25, 2014
62
1
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:

zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20121212/opcache.so
opcache.enable=1
opcache.enable_cli=1
(... some other settings...)
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:

zend_extension=opcache.so
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 ;)
 
Last edited:

TCB13

Well-Known Member
Jul 25, 2014
62
1
8
cPanel Access Level
Root Administrator
Hello :)

Please let us know if the following thread is helpful:

opcache config problem

Thank you.
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,883
2,256
463
Could you open a support ticket with Cloud Linux about the error message in the LVE Manager interface? Their help desk is located at:

https://helpdesk.cloudlinux.com/

Thank you.