Please help me get FastCGI working with nginx

Rt Ibmer rtibmx at
Mon Aug 4 21:50:44 MSD 2008

> seems from your mail that you might want to try running
> /usr/local/bin/ 
> php-cgi instead of /usr/local/bin/php. php is the CLI
> version, php-cgi  
> is the cgi/fcgi version.

A big thanks to you and the others that replied!  The above turned out to be my issue.  I was not aware that the php-cgi was created as its own binary. 

> As has been said, php-fpm is probably the smart way to go,

I applied the php-fpm path and rebuilt - things seem to be working great!

One question though - what are you guys using for start/stop scripts for php-fpm upon boot up?

Is it just a simple matter of making a startup script in init.d that just does "/path/php-cgi --fpm" ?  Or is there something else important that I am missing as far as startup/shutdown go?

I was thinking of also perhaps adding some switches like restart workers and reopening logs to the startup script that would then look up the PID and send the appropriate signal accordingly.  If someone else has already done so or has a startup script they can share can you please post it?

Thanks again for the tremendous help all!


More information about the nginx mailing list