#!/bin/sh # $Id: spawn-php.sh,v 1.3 2006/07/12 11:50:05 aost Exp $ # ## ABSOLUTE path to the PHP binary PHPFCGI="/usr/local/bin/php" FCGIPORT="9000" FCGIADDR="127.0.0.1" ## number of PHP children to spawn PHP_FCGI_CHILDREN=5 ## maximum number of requests a single PHP process can serve before it is restarted PHP_FCGI_MAX_REQUESTS=1000 ## IP addresses from which PHP should access server connections #FCGI_WEB_SERVER_ADDRS="127.0.0.1" PATH0="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin" ## if this script is run as root, switch to the following user USERID=www GROUPID=www ################## no config below this line if test x$PHP_FCGI_CHILDREN = x; then PHP_FCGI_CHILDREN=5 fi ALLOWED_ENV="$ALLOWED_ENV PHP_FCGI_CHILDREN" ALLOWED_ENV="$ALLOWED_ENV PHP_FCGI_MAX_REQUESTS" ALLOWED_ENV="$ALLOWED_ENV FCGI_WEB_SERVER_ADDRS" if test x$UID = x0; then EX="/bin/su -m -c \"$PHPFCGI -q -b $FCGIADDR:$FCGIPORT\" $USERID" else EX="$PHPFCGI -b $FCGIADDR:$FCGIPORT" fi echo $EX E= for i in $ALLOWED_ENV; do E="$E $i=${!i}" done