注意:php
phpfpm修改成你本身的php-fpm的位置便可sql
把這個文件放在/etc/init.d下ide
起名php-fpmphp-fpm
chkconfig --add php-fpmspa
service php-fpm start便可啓動rest
- #!/bin/sh
- # chkconfig: 2345 64 36
- # description: PHP-FPM
- phpfpm="/usr/local/sbin/php-fpm"
- prog="php-fpm"
- pidfile="/usr/local/php/php-fpm.pid"
- start()
- {
- echo -n $"Starting $prog....."
- $phpfpm -g /usr/local/php/php-fpm.pid
- echo ".........ok"
- netstat -atlpn |grep php-fpm
- }
- stop()
- {
- echo -n $"Stoping $prog......"
- kill -QUIT `cat $pidfile`
- echo "..........ok"
- }
- reload()
- {
- echo -n $"Reload $prog......"
- kill -USR2 `cat $pidfile`
- echo "...........ok"
- }
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- stop
- start
- ;;
- reload)
- reload
- ;;
- *)
- echo "Usage: $0 {start|stop|restart|reload}"
- exit 2;
- esac