3 # PHP-FastCGI start/stop script
8 PATH
="/bin:/usr/bin:/sbin:/usr/sbin"
9 PHP_FCGI
="/usr/sbin/php-fcgi"
10 PIDFILE
="/var/run/php-fcgi.pid"
12 test -f ${PHP_FCGI} ||
exit 0
14 function start_php_fcgi
{
15 if [ -f ${PIDFILE} ]; then
16 stat_busy
"FastCGI is already running"
19 fcgi_ver
=`/usr/sbin/php-fcgi -v`
20 stat_busy
"Starting ${fcgi_ver}"
21 ${PHP_FCGI} &> /dev
/null
23 if [ "${result}" = "0" ]; then
27 fcgi_Error
=`/usr/sbin/php-fcgi 2>&1`
28 stat_busy
"$fcgi_Error"
34 function stop_php_fcgi
{
35 if [ -f ${PIDFILE} ]; then
36 stat_busy
"Stopping PHP FastCGI server daemons"
37 ${PHP_FCGI} -k &> /dev
/null
40 stat_busy
"FastCGI is not running"
57 echo "Usage: $0 {start|stop|restart}"