Configure PHP-FPM
Default PHP installation directory:/usr/local/php
First copy the configuration file and edit it
Copy Code code as follows:
Cp/usr/local/php/etc/php-fpm.conf.default->/usr/local/php/etc/php-fpm.conf
Vi/usr/local/php/etc/php-fpm.conf
Make FPM Start service
Copy the following code, VI/ETC/INIT.D/PHP-FPM, save
Copy Code code as follows:
#!/bin/bash
#php-fpmstartupscriptforphp-fpm,afastcgiimplementation
#thisscriptwascreatedbytonyat2010.07.21,basedonjackbillow ' Snginxscript.
#itisv. 0.0.1version.
#ifyoufindanyerrorsonthisscripts, Pleasecontacttony.
#bysendingmailtotonytzhouatgmaildotcom.
#
#chkconfig:-8515
#description:p Hp-fpmisanalternativefastcgiimplementation,withsomeadditionalfeaturesusefulforsitesofanysize, Especiallybusiersites.
#
#processname:p HPFPM
#pidfile:/usr/local/php/var/run/phpfpm.pid
#config:/usr/local/php/etc/phpfpm.conf
phpfpm=/usr/local/php/sbin/php-fpm
Config=/usr/local/php/lib/php.ini
Pid=/usr/local/php/var/run/php-fpm.pid
Retval=0
Prog= "PHPFPM"
#Sourcefunctionlibrary.
./etc/rc.d/init.d/functions
#Sourcenetworkingconfiguration.
./etc/sysconfig/network
#Checkthatnetworkingisup.
[${networking}= "No"]&&exit0
[-x$phpfpm]| | Exit0
#Startphpfpmdaemonsfunctions.
Start () {
If[-e$pid];then
echo "Phpfpmisalreadyrunning ..."
Exit1
Fi
echo-n$ "Starting$prog:"
Daemon$phpfpm-c${config}
Retval=$?
Echo
[$RETVAL =0]&&TOUCH/VAR/LOCK/SUBSYS/PHPFPM
Return$retval
}
#Stopphpfpmdaemonsfunctions.
Stop () {
echo-n$ "Stopping$prog:"
killproc$phpfpm
Retval=$?
Echo
[$RETVAL =0]&&rm-f/var/lock/subsys/phpfpm/var/run/phpfpm.pid
}
#reloadphpfpmservicefunctions.
Reload () {
echo-n$ "Reloading$prog:"
#kill-hup ' Cat${pid} '
Killproc$phpfpm-hup
Retval=$?
Echo
}
#Seehowwewerecalled.
Case "$" in
Start
Start
;;
Stop
Stop
;;
Reload
Reload
;;
Restart)
Stop
Start
;;
Status
Status$prog
Retval=$?
*)
echo$ "Usage: $prog {start|stop|restart|reload|status|help}"
Exit1
Esac
Exit$retval
chmod+x/etc/rc.d/init.d/php-fpm# Add Execute Permissions
chkconfigphp-fpmon# Set boot up
Start/etc/init.d/php-fpmstart
Stop/etc/init.d/php-fpmstop
Restart/etc/init.d/php-fpmrestart