简体   繁体   English

禁用php.ini中的opcache.enable不能在CentOS上运行

[英]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 . 我有一台安装了PHP 5.6的CentOS 7机器,它通过Webtatic的php56w repo安装 I installed the opcache extension with yum install php56w-opcache . 我用yum install php56w-opcache安装了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,所以在我的/etc/php.ini文件中,我输入以下行:

opcache.enable = 0

However, after restarting my webserver, I can see in phpinfo() the opcache.enable is still On. 但是,在重新启动我的web服务器之后,我可以在phpinfo()看到opcache.enable仍然是On。

Did I miss something? 我错过了什么? How can I turn the opcache off? 如何关闭opcache?

Installing php56w-opcache creates a file named /etc/php.d/10-opcache.ini. 安装php56w-opcache会创建一个名为/etc/php.d/10-opcache.ini的文件。 This file contains the option opcache.enable=1 by default, and will override your settings in php.ini . 此文件默认包含选项opcache.enable=1 ,并将覆盖php.ini的设置。

I edited that file and changed opcache.enable=1 to opcache.enable=0 then restarted Apache and now opcache is disabled. 我编辑了该文件,并将opcache.enable=1更改为opcache.enable=0然后重新启动Apache,现在禁用了opcache。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM