Php-fpm executable file garbled solution
- Cp/usr/local/php/etc/php-fpm.conf.default->/usr/local/php/etc/php-fpm.conf
6/usr/local/php/etc/php-fpm.conf
Create fpm startup service vi/etc/init. d/php-fpm and save
-
#! /Bin/bash
- # Php-fpmStartupscriptforphp-fpm, aFastCGIimplementation
- # Thisscriptwascreatedbytonyat2010.07.21, basedonjackbillow 'snginxscript.
- # Itisv.0.0.1version.
- # Ifyoufindanyerrorsonthisscripts, pleasecontacttony.
- # Bysendingmailtotonytzhouatgmaildotcom.
- #
- # Chkconfig:-8515
- # Description: php-fpmisanalternativeFastCGIimplementation, withsomeadditionalfeaturesusefulforsitesofanysize, especiallybusiersites.
- #
- # Processname: phpfpm
- # 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 "$1" in
- Start)
- Start
- ;;
- Stop)
- Stop
- ;;
- Reload)
- Reload
- ;;
- Restart)
- Stop
- Start
- ;;
- Status)
- Status $ prog
- RETVAL =$?
-
*)
- Echo $ "Usage: $ prog {start | stop | restart | reload | status | help }"
- Exit 1
- Esac
- Exit $ RETVAL
Subsequent steps: add the execution permission chmod + x/etc/rc. d/init. d/php-fpm # set to start chkconfigphp-fpmon # Start/etc/init. d/php-fpmstart stop/etc/init. d/php-fpmstop restart/etc/init. d/php-fpmrestart |