Opcache Issue
4 posts by 2 authors in: Forums > CMS Builder
Last Post: 2 hours ago (RSS)
By mark99 - Friday at 8:57am
When I try to add my usual file system based opcache to the main CMSB (3.84) php.ini file, which looks like this (file path changed for security below):
zend_extension=opcache.so;
opcache.enable=1;
opcache.memory_consumption=32;
opcache.interned_strings_buffer=8;
opcache.max_accelerated_files=3000;
opcache.revalidate_freq=180;
opcache.fast_shutdown=0;
opcache.enable_cli=0;
opcache.revalidate_path=0;
opcache.validate_timestamps=1;
opcache.max_file_size=0;
opcache.file_cache=/blah/wwwroot/.opmeow;
opcache.file_cache_only=1;
When I then load admin > General Settings I get a pop-up that says:
"updatePhpMysqlDateTime: [object Object]"
The only option is to click 'Ok'
I then see various errors like these within the same admin page:
Warning: Failed loading Zend extension 'opcache.so' (tried: /usr/lib/php8.5/extensions/opcache.so (/usr/lib/php8.5/extensions/opcache.so: cannot open shared object file: No such file or directory), /usr/lib/php8.5/extensions/opcache.so.so (/usr/lib/php8.5/extensions/opcache.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
/MYFOLDER/system/uploads/
Warning: Failed loading Zend extension 'opcache.so' (tried: /usr/lib/php8.5/extensions/opcache.so (/usr/lib/php8.5/extensions/opcache.so: cannot open shared object file: No such file or directory), /usr/lib/php8.5/extensions/opcache.so.so (/usr/lib/php8.5/extensions/opcache.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
The php.ini code works in every other PHP based system on the server, so what is going wrong here? I can turn these two 'Off' and the problem goes away, but obviously this isn't a fix:
display_startup_errors = On
display_errors = On
By Dave - Yesterday at 9:48pm
Hi Mark,
That is curious. I've attached a test script that shows whether OPcache is running and the key settings it's using (which php.ini is loaded, where PHP looks for the extension, and so on).
Can you run it from a location where OPcache is already working, and again from your cmsb folder, and let me know how the two differ?
It's also worth dropping it into a parallel directory (e.g.,/opcache_test/) to see if something in the CMSB .htaccess or config files is affecting it.
Let me know what you find. Thanks!
interactivetools.com
By mark99 - 4 hours ago
Ok I figured it out. It's because Opcache is now enabled by default from PHP 8.5 onwards, so if you have a php.ini with this line:
zend_extension=opcache.so;
Then it causes a bit of a conflict and needs to be commented out or removed:
;zend_extension=opcache.so;
By Dave - 2 hours ago
Hi mark99,
Okay, great. Glad it's working and thanks for the update!
interactivetools.com