Summary: PHP-FPM is not registered as a system service by default after installation, so you need to add system service scripts manually. Create a new php-fpm file under the/ETC/INIT.D directory and change the permissions. 1, detection/usr/local/php/var/run/php-fpm.pid whether to save CentOS6.4 add PHP-FPM system Services in 1.1, does not exist: Remove/usr/local/php/etc/php-fpm.conf "; PID = Run/php-fpm.pid "In front of the semicolon, and restart PHP-FPM will automatically generate php-fpm.pid1.2, how to restart PHP-FPM (of course, restart the system is also possible) 1.2.1, view php-fpm current Process Ps-ef | grep php-fpm1.2.2, end php-fpm All processes: Kill-9 12281.2.3, start php-fpm:/usr/local/php/sbin/php-fpm2, new php-fpm file 2.1, New file: vi/etc/init.d/php-fpm2.2, add content as follows
| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
#! /bin/sh# Comments to Chkconfig on centos# chkconfig:2345 sbin:/bin:/usr/sbin:/usr/bindesc= "php-fpm daemon" name=php-fpmdaemon=/usr/local/php/sbin/$NAME configfile=/ usr/local/php/etc/php-fpm.confpidfile=/usr/local/php/var/run/$NAME. pidscriptname=/etc/init.d/$NAME # Gracefully exit if the package has been Removed.test-x $DAEMON | | Exit 0 d_start () { $DAEMON-y $CONFIGFILE | | echo-n "already Running"} d_stop () { kill- QUIT ' Cat $PIDFILE ' | | Echo-n "Not Running"} d_reload () { kill-hup ' cat $PIDFILE ' | | echo-n "can ' t reload"} case "$" I N start) echo-n "Starting $DESC is Success" d_start echo "." ;; stop)        &NBSp;echo-n "Stopping $DESC is Success" d_stop echo "." ;; reload) echo-n "Reloading $DESC configuration ..." d_reload echo " Reloaded. " ;; restart) echo-n "Restarting $DESC is success" d_stop sleep 1 d_start echo "." ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart| Force-reload} ">&2 exIt 3 ;; Esac |
3, modify its permissions and boot 3.1, modify permissions: chmod 755/etc/init.d/php-fpm3.2, boot: chkconfig php-fpm on3.3, check the start-up service: Chkconfig--list4, Note 4.1: Service PHP-FPM start4.2, stop services: Service PHP-FPM stop4.3, restart Services: Service PHP-FPM RELOAD5, concluding remarks 5.1, this article has any errors, or have any questions, Welcome message description.
CentOS 6 Add PHP-FPM system service