Quantcast
Channel: php – ma.ttias.be
Viewing all articles
Browse latest Browse all 69

PHP Warning: Zend OPcache can’t be temporary enabled

$
0
0

The post PHP Warning: Zend OPcache can’t be temporary enabled appeared first on ma.ttias.be.

I recently ran into this problem on a PHP server and I figure I'd share the solution.

The logs were being filled with this alert:

[24-Mar-2016 Europe/Brussels] PHP Warning:  Zend OPcache can't be temporary enabled (it may be only disabled till the end of request) in Unknown on line 0
[24-Mar-2016 Europe/Brussels] PHP Warning:  Zend OPcache can't be temporary enabled (it may be only disabled till the end of request) in Unknown on line 0
[24-Mar-2016 Europe/Brussels] PHP Warning:  Zend OPcache can't be temporary enabled (it may be only disabled till the end of request) in Unknown on line 0

The interesting problem here is that, by default, OPcache was enabled. The default php.ini contained this value:

$ grep opcache /etc/php.ini
opcache.enable = 1

The problem occurred when I tried to enable the OPcache again. This time, from within the PHP-FPM pool configuration.

$ grep opcache /etc/php-fpm.d/*
php_admin_value[opcache.enable] = on

It appears that PHP isn't amused when you try to enable the OPcache again, when it's already enabled. It does appear to be just a cosmetic issue and doesn't actually impact the functionality of the PHP code itself.

Either way, in this case the fix was to just remove the OPcache setting from PHP-FPM and keep it enabled in the default php.ini file.

The post PHP Warning: Zend OPcache can’t be temporary enabled appeared first on ma.ttias.be.


Viewing all articles
Browse latest Browse all 69

Latest Images

Trending Articles



Latest Images