G. Plante
G. Plante

Reputation: 469

Disabling opcache.enable in php.ini not working on CentOS

I have a CentOS 7 machine with PHP 5.6 installed on it via Webtatic's php56w repo. I installed the opcache extension with yum install php56w-opcache.

Since this is a development machine, I want to turn opcache off by default, so in my /etc/php.ini file, I put the following line:

opcache.enable = 0

However, after restarting my webserver, I can see in phpinfo() the opcache.enable is still On.

Did I miss something? How can I turn the opcache off?

Upvotes: 5

Views: 8055

Answers (1)

G. Plante
G. Plante

Reputation: 469

Installing php56w-opcache creates a file named /etc/php.d/10-opcache.ini. This file contains the option opcache.enable=1 by default, and will override your settings in php.ini.

I edited that file and changed opcache.enable=1 to opcache.enable=0 then restarted Apache and now opcache is disabled.

Upvotes: 5

Related Questions