先查看phpinfo,找到opcache的配置文件。我的是独立出来的放在:/usr/local/php/etc/php.d/opcache.ini。
opcache.enable_cli=0
opcache.enable=0
/bin/systemctl restart php-fpm.service
访问后再修改为1像上面这样restart一下即可。
打开页面看到如下错误:“PHP
is apparently set up to strip inline doc blocks. This will make several
core apps inaccessible.”这可能是由缓存/加速器造成的,例如 Zend OPcache 或
eAccelerator。打开你的打开php.ini文件,找到:[opcache],设置为:opcache.enable=0 和
opcache.enable_cli=0。
[opcache]
opcache.enable=0
opcache.enable_cli=0
[root@iZ25dcp92ckZ etc]# php -v
PHP 5.6.20 (cli) (built: Jul 11 2016 11:15:33)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
with Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies
还没生效?
[root@iZ25dcp92ckZ php.d]# php -i|grep opcache
Additional .ini files parsed => /usr/local/php/etc/php.d/opcache.ini
找到:
/usr/local/php/etc/php.d/opcache.ini
[opcache]
zend_extension=/usr/local/php/ext/opcache.so
opcache.enable=0
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.save_comments=0
opcache.fast_shutdown=1
opcache.enable_cli=0
;opcache.optimization_level=0
[root@iZ25dcp92ckZ php.d]# service php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm done