PHP配置ZendOpcache插件加速
时间:2020-10-10 11:45:39|栏目:PHP代码|点击: 次
php原版本情况:
[root@www sbin]# php -v PHP 5.6.23 (cli) (built: Dec 7 2018 09:00:11) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
1.修改php.ini,在最后填写如下代码:
[root@www php]# tail php.ini [opcache] zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/opcache.so;extension=opcache.so opcache.memory_consumption=32 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=1000 opcache.revalidate_freq=60 opcache.fast_shutdown=1 opcache.enable_cli=1
2.检查结果
[root@www php]# php -v PHP 5.6.23 (cli) (built: Dec 7 2018 09:00:11) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
重启php-fpm之后,在info.php页面也能看到相关情况。
总结