3

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?

Mark Amery
  • 143,130
  • 81
  • 406
  • 459
G. Plante
  • 429
  • 1
  • 5
  • 13
  • Did you update the correct php.ini file? Most installations have at least two, one for web and a second for command line – Mark Baker Dec 24 '14 at 18:19

1 Answers1

3

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.

Mark Amery
  • 143,130
  • 81
  • 406
  • 459
G. Plante
  • 429
  • 1
  • 5
  • 13