Install LNMP environment,PHP5.4.37 version installed successfully, add PHP-FPM service to system startup item, error service PHP-FPM does not support Chkconfig ; PHP-FPM service does not support Chkconfig ;
Edit/etc/init.d/php-fpm startup script, after opening is garbled, look for the reason is copy php-fpm startup script file error.
From the same environment in the same version of PHP copy php-fpm startup script, re-edit paste, save exit, you can normally join the startup item; A friend who encounters the same situation can copy the script directly, keeping the same path as the script content.
The PHP-FPM startup script reference is as follows:
#! /bin/sh### begin init info# provides: php-fpm# Required-Start: $remote _fs $network # required-stop: $remote _fs $network # default-start: 2 3 4 5# default-stop: 0 1 6# Short-Description: starts php-fpm# Description: starts the php fastcgi process manager daemon### end init infoprefix=/usr/local/phpexec_prefix=${prefix}php_fpm_bin=${exec_prefix}/sbin/php-fpmphp_fpm_conf=${prefix}/ etc/php-fpm.confphp_fpm_pid=${prefix}/var/run/php-fpm.pidphp_opts= "--fpm-config $php _fpm_conf --pid $php _fpm_pid "wait_for_pid () { try=0 while test $try -lt 35 ; do case "$" in ' created ') if [ -f "$" ] ; then try= ' break fi ;; ' removed ') if [ ! -f "$" ] ; then try= ' break fi ;; esac echo -n . try= ' expr $try + 1 ' sleep 1 done}case " in start" echo -n "starting php-fpm " $php _fpm_bin --daemonize $php _opts if [ " $? " != 0 ] ; then echo " failed" exit 1 fi wait_for_pid created $php _fpm_pid if [ -n "$try" ] ; then echo " failed" exit 1 else echo " done" fi ;; stop) echo -n "gracefully shutting down php-fpm " if [ ! -r $php _fpm_pid ] ; then echo "Warning, no pid file found - php-fpm is not running ? " exit 1 fi kill -QUIT ' cat $php _fpm_pid ' wait_for_pid removed $php _fpm_pid if [ -n "$try" ] ; then echo " failed. use force-quit" exit 1 else echo " done" fi ;; status) if [ ! -r $php _fpm_pid ] ; then echo "php-fpm is stopped" exit 0 fi&Nbsp; pid= ' cat $php _fpm_pid ' if ps -p $PID | grep -q $ pid; then echo "php-fpm (pid $PID) is running ..." else echo "Php-fpm dead but pid file exists" fi ;; force-quit) echo -n "terminating php-fpm " if [ ! -r $php _fpm_pid ] ; then echo "warning, no pid file found - php-fpm is not running ? " exit 1 fi kill -TERM ' cat $php _fpm_pid ' wait_for_pid removed $php _fpm_pid if [ -n "$try" ] ; then echo " failed" exit 1 else echo " done" fi ;; restaRT) $0 stop $0 start ;; reload) echo -n "reload service php-fpm " if [ ! -r $php _fpm_pid ] ; then echo "Warning, no pid file found - php-fpm is not running ? " exit 1 fi kill -USR2 ' cat $php _fpm_pid ' echo " done" ;; *) echo "Usage: $0 {start|stop|force-quit|restart|reload|status}" exit 1 ;; Esac
This article is from the "Model Student's Learning blog" blog, please be sure to keep this source http://8802265.blog.51cto.com/8792265/1650859
php-fpm startup script in LNMP environment