在我的服务器上(FreeBSD 11),php-fpm服务不再干净利落地了。
# service php-fpm status
php_fpm is not running.
但如果我搜索正在运行的实例,我会看到它的工作情况(事实上,Web应用程序也使用它并正在运行:
# top | grep php-fpm
572 root 1 20 0 265M 4688K kqread 0 3:58 0.00% php-fpm
50875 www 1 31 0 273M 22188K accept 1 0:12 0.00% php-fpm
50872 www 1 20 0 271M 20816K accept 1 0:10 0.00% php-fpm
51438 www 1 30 0 269M 15024K accept 1 0:05 0.00% php-fpm
如果我杀了它并手动启动它实际上开始但抱怨无法启动(“service php-fpm restart”上的相同输出):
# service php-fpm start
Performing sanity check on php-fpm configuration:
[10-Mar-2017 13:10:54] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20131226/apc.so' - Cannot open "/usr/local/lib/php/20131226/apc.so" in Unknown on line 0
[10-Mar-2017 13:10:54] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful
Starting php_fpm.
[10-Mar-2017 13:10:54] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20131226/apc.so' - Cannot open "/usr/local/lib/php/20131226/apc.so" in Unknown on line 0
[10-Mar-2017 13:10:54] ERROR: An another FPM instance seems to already listen on /var/run/php5-fpm.sock
[10-Mar-2017 13:10:54] ERROR: FPM initialization failed
/usr/local/etc/rc.d/php-fpm: WARNING: failed to start php_fpm
什么能产生这个?
答案 0 :(得分:0)
Mr.Gosh给出了正确的答案。问题是pid文件,可能没有在 php-fpm.conf 中声明路径/文件名,如下所示:
include=etc/php-fpm.d/*.conf
[global]
pid = run/php-fpm.pid
events.mechanism = kqueue
error_log = /home/user/logs/php-error.log