PHP error:ERROR: No pool defined. at least one pool section must be specified in config file

如下所示的报错发生在php-fpm启动的过程中,具体如下:

[root@linuxme php-7.0.9]# pwd
/usr/local/php-7.0.9
[root@linuxme php-7.0.9]#
[root@linuxme php-7.0.9]# ls -ltr
total 28
drwxr-xr-x 3 root root 4096 Aug 16 10:14 lib
drwxr-xr-x 4 root root 4096 Aug 16 10:14 var
drwxr-xr-x 2 root root 4096 Aug 16 10:14 sbin
drwxr-xr-x 4 root root 4096 Aug 16 10:14 php
drwxr-xr-x 3 root root 4096 Aug 16 10:14 include
drwxr-xr-x 2 root root 4096 Aug 16 10:14 bin
drwxr-xr-x 3 root root 4096 Aug 16 10:24 etc
[root@linuxme php-7.0.9]#
[root@linuxme php-7.0.9]# sbin/php-fpm
[16-Aug-2016 10:26:28] WARNING: Nothing matches the include pattern '/usr/local/php-7.0.9/etc/php-fpm.d/*.conf' from /usr/local/php-7.0.9/etc/php-fpm.conf at line 125.
[16-Aug-2016 10:26:28] ERROR: No pool defined. at least one pool section must be specified in config file
[16-Aug-2016 10:26:28] ERROR: failed to post process the configuration
[16-Aug-2016 10:26:28] ERROR: FPM initialization failed
[root@linuxme php-7.0.9]#

造成该问题的原因是:
路径【/usr/local/php-7.0.9/etc/php-fpm.d/】下没有找到【*.conf】的配置文件(config file)。
如下:

[root@linuxme php-7.0.9]# cd /usr/local/php-7.0.9/etc/php-fpm.d/
[root@linuxme php-fpm.d]# ls -ltr
total 20
-rw-r--r-- 1 root root 18536 Aug 16 10:14 www.conf.default
[root@linuxme php-fpm.d]#

Fix:

[root@linuxme php-fpm.d]# pwd
/usr/local/php-7.0.9/etc/php-fpm.d
[root@linuxme php-fpm.d]# ls
www.conf.default
[root@linuxme php-fpm.d]# cp www.conf.default www.conf
[root@linuxme php-fpm.d]#
[root@linuxme php-fpm.d]# ls -ltr
total 40
-rw-r--r-- 1 root root 18536 Aug 16 10:29 www.conf.default
-rw-r--r-- 1 root root 18536 Aug 16 10:29 www.conf
[root@linuxme php-fpm.d]#

然后再次尝试启动PHP:

[root@linuxme php-fpm.d]# /usr/local/php-7.0.9/sbin/php-fpm
[root@linuxme php-fpm.d]#
[root@linuxme php-fpm.d]# ps -ef | grep --color php
root     13291     1  0 10:29 ?        00:00:00 php-fpm: master process (/usr/local/php-7.0.9/etc/php-fpm.conf)
nobody   13292 13291  0 10:29 ?        00:00:00 php-fpm: pool www                
nobody   13293 13291  0 10:29 ?        00:00:00 php-fpm: pool www                
root     13295 26846  0 10:29 pts/0    00:00:00 grep --color php
[root@linuxme php-fpm.d]#
[root@linuxme php-fpm.d]# netstat -tupln | grep --color php
tcp        0      0 127.0.0.1:9000              0.0.0.0:*                   LISTEN      13291/php-fpm      
[root@linuxme php-fpm.d]#

OK!

Last modification:December 17th, 2018 at 01:38 am
If you think my article is useful to you, please feel free to appreciate

Leave a Comment