Home >Backend Development >PHP Problem >How to solve php fpm error problem
Solution to php fpm error: First check the "/usr/local/php/var/run" directory and the corresponding pid file; then check whether the configuration file has errors; then open the "php-fpm" file ; Finally, change the path to an absolute path and restart "php-fpm".
php-fpm failed to start:
Recommended: "PHP Tutorial"
After installing LNMP today, I found that php-fpm could not be started.
The error is as follows:
[root@localhost php-5.4.37]# service php-fpm start Starting php-fpm ................................... failed
Compile and install
The compilation parameters are as follows:
./configure --prefix=/usr/local/php --with-config-file-path=/etc/php --enable-fpm --with-fpm-user --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql/ --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --with-curl --enable-ftp --enable-mbstring --enable-exif --disable-ipv6 make && make install
2. Copy the configuration file and startup script
mv /usr/local/php/etc/{php-fpm.conf.default,php-fpm.conf} cp /usr/local/src/php-5.4.37/sapi/fpm/init.php-fpm /etc/init.d/php-fpm chmod 755 /etc/init.c/php-fpm chkconfig --add php-fpm service php-fpm start
and report an error when starting.
It can be started directly during installation. Today is special.
Then restart it, and the error is as follows:
[root@localhost php-5.4.37]# service php-fpm restart Gracefully shutting down php-fpm warning, no pid file found - php-fpm is not running ? Starting php-fpm [16-May-2015 19:23:22] ERROR: unable to bind listening socket for address '127.0.0.1:9000': Address already in use (98) [16-May-2015 19:23:22] ERROR: FPM initialization failed failed## 了 View the/usr/local/pHP/var/run directory, there are corresponding correspondence below pid file. But the error message shows that there is no such pid file. Checking the log also shows that php-fpm is running. Then check the configuration file for errors /usr/local/php/sbin/php-fpm -t Check that there are no syntax errors, and then check the /etc/init.d/php-fpm file The contents and paths of those files are all written in the format @xxx@/php-fpm.pid. Then change it to an absolute path, killall php-fpm, and then start php-fpm, it succeeds.
The above is the detailed content of How to solve php fpm error problem. For more information, please follow other related articles on the PHP Chinese website!