Answers for "php fastcgi process"

0

php fastcgi process

#!/bin/sh
# NGINX FastCGI php5 startup shell script
# Feedback <[email protected]>
# http://bash.cyberciti.biz/web-server/fastcgi-php-server-start-stop-script/
# Set ME #
PROVIDES=php-cgi
LIGHTTPD_FCGI=/usr/local/bin/spawn-fcgi 
SERVER_IP=127.0.0.1
SERVER_PORT=9000 
SERVER_USER=www
SERVER_GROUP=www 
PHP_CGI=/usr/local/bin/php-cgi
PGREP=/bin/pgrep
KILLALL=/usr/bin/killall
### No editing below ####
cmd=$1
 
pcgi_start(){
  	echo "Starting $PROVIDES..."
 	$LIGHTTPD_FCGI -a $SERVER_IP -p $SERVER_PORT -u $SERVER_USER -g $SERVER_GROUP -f $PHP_CGI
}
 
pcgi_stop(){
	echo "Killing $PROVIDES..."
	$KILLALL $PROVIDES
}
 
pcgi_restart(){
	pcgi_stop
	pcgi_start
}
 
pcgi_status(){
        $PGREP $PROVIDES > /dev/null
	[ $? -eq 0  ] && echo "$PROVIDES running" || echo "$PROVIDES NOT running" 
 
}
 
pcgi_help(){
  	echo "Usage: $0 {start|stop|restart|status}"
}
 
 
case ${cmd} in
[Ss][Tt][Aa][Rr][Tt]) pcgi_start;;
[Ss][Tt][Oo][Pp]) pcgi_stop;;
[Rr][Ee][Ss][Tt][Aa][Rr][Tt]) pcgi_restart;;
[Ss][Tt][Aa][Tt][Uu][Ss]) pcgi_status ;;
*)      pcgi_help ;;
esac
Posted by: Guest on June-28-2021

Browse Popular Code Answers by Language