PHP init script to go with nginx?

Volodymyr Kostyrko c.kworr at gmail.com
Fri Jun 13 15:46:37 MSD 2008


Phillip B Oldham wrote:
> Also, I think there may be a bug with the original script
>> Linux:
>>
>> #!/bin/ash
>> #
>> # chkconfig: 234 25 75
>> # description: php FastCGI daemon
>>
>> case $1 in
>> restart)
>>         /etc/init.d/phpFcgid stop
>>         /etc/init.d/phpFcgid start
>>         ;;
>> start)
>>         users="www"
>>         www_childs='2'
>>         for user in ${users}; do
>>                 socketdir="/tmp/.fastcgi.${user}"
>>                 mkdir -p ${socketdir}
>>                 chown ${user}:nobody ${socketdir}
>>                 chmod 0750 ${socketdir}
>>                 eval export PHP_FCGI_CHILDREN=\${${user}_childs}
>>                 su -m ${user} -c "/opt/php5/bin/php-cgi -b 
>> ${socketdir}/socket&"
>>         done
>>         ;;
>> stop) /usr/bin/pkill php-cgi ;;
>> esac
> On my CentOS box, service phpFcgid start returns the following:
> env: /etc/init.d/phpFcgid: No such file or directory

This script is actually the contents of /etc/init.d/phpFcgid. To start 
using it you should put it there, make it runnable and register it with 
chkconfig. You should also have php installed with FastCgi support and 
you can build it alone as I do, just in my case php is installed with 
prefix /opt/php5.

-- 
Sphinx of black quartz judge my vow.






More information about the nginx mailing list