Nonsense not much to say that directly on the steps
1, modify the php-fpm.conf configuration file
Modify/usr/local/php/etc/php-fpm.conf (of course this is related to your PHP path) configuration file
Start Pid=run/php-fpm.pid
; Pid file
; note:the default prefix Is/usr/local/php/var
; Default value:none
pid = run/php-fpm.pid
Start Error_log=log/php-fpm.log
; Error log file
; If it ' s set to "Syslog", the log is sent to Syslogd instead of being written
;
note:the default prefix Is/usr/local/php/var
; Default value:log/php-fpm.log
error_log = Log/php-fpm.log
2. Create/etc/init.d/php files
root@aliyun:~# cat/etc/init.d/php #!/bin/bash #Author: iranw #E-mail:wang_wenguan#yeah.net #Website: http:// www.phpno.com # pid file pid= "/usr/local/php/var/run/php-fpm.pid" # php-fpm path&file phpfpm= "/usr/local/php/sbin/ PHP-FPM "param=$1 phpnum= ' Ps-ef | grep php-fpm | Wc-l ' If ["$param" = "Stop"]; Then if ["$phpnum" = "1"];
Then echo "PHP process does not exist." Exit 1 fi kill ' cat $pid ' echo ' Close PHP processes. OK "Exit 1 fi If [" $param "=" Start "]; Then if ["$phpnum"!= "1"];
Then echo "PHP process exist." Exit 1 fi $phpfpm echo "Open PHP processes. OK "Exit 1 fi If [" $param "=" restart "]; Then if ["$phpnum" = "1"]; Then echo "PHP process does not exist.
Stop Failed. " Else kill ' cat $pid ' for i in ' ps-ef | grep php-fpm | Grep-v grep |
awk {' Print $ '} ' do kill-9 $i echo ' kill $i successed. ' Done ECho "Close PHP processes. Ok "fi $phpfpm if [" $phpnum "!=" 1 "]; Then echo "Open PHP processes. OK "Else echo" Open PHP processes.
Failed. "
Fi Exit 1 fi
3, modify the permissions
4. Implementation results