php-fpm 配置文件检测

用过 Nginx 的兄弟都知道,修改 Nginx 配置文件以后,可使用php

nginx -t

来检测配置文件是否有语法错误。nginx

今天配置 opcache 的时候,发现 php-fpm 也能够检测 php-fpm.conf , php.ini 等配置文件的正确与否。php-fpm

sudo php-fpm7.0 -t [28-Dec-2018 08:57:02] NOTICE: configuration file /etc/php/7.0/fpm/php-fpm.conf test is successful sudo php-fpm7.0 -t Fri Dec 28 09:03:22 2018 (3365): Fatal Error Zend OPcache cannot allocate buffer for interned strings

没有问题以后,就能够重启 fpm 服务了。spa

Fatal Error Zend OPcache cannot allocate buffer for interned strings

这个错误的缘由是,我把 interned_strings_buffer 的大小设置成了等于 memory_consumption,而 interned_strings_buffer 的配置理论上应该比 memory_consumption 小。code

[opcache] opcache.enable=1 opcache.memory_consumption=64 opcache.interned_strings_buffer=4 // 原来为 64 opcache.max_accelerated_files=2000 opcache.validate_timestamps=0 opcache.save_comments=1 opcache.fast_shutdown=1
相关文章
相关标签/搜索