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

nginx -t 

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

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

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 服务了。

Fatal Error Zend OPcache cannot allocate buffer for interned strings

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

[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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-11
  • 2021-11-04
  • 2021-12-29
  • 2021-11-03
  • 2021-12-06
  • 2022-12-23
猜你喜欢
  • 2021-09-10
  • 2021-07-24
  • 2021-12-16
  • 2022-01-06
相关资源
相似解决方案