While trying to configure php-cgi on a CentOS 5 server running nginx, I run into this:

[root@~~~~~~~ run]# /etc/init.d/php_cgi start

Starting php-cgi: spawn-fcgi: child exited with: 255


I'm not 100% sure what's happening here, but no Google result returns anything regarding error code 255.

I was following [this guide][1] to set up php-cgi. What could the problem be?


lighttpd and lighttpd-fastcgi both don't provide the binary that is supposed to be started with the script he provides. (/usr/bin/spawn-fcgi).

You'd better ask the guy who wrote the tutorial where he get /usr/bin/spawn-fcgi because on my server there is no way to install it with yum. He says "Install spawn-fcgi package using yum command" but it doesn't work.

Make sure you use the same repositories than him, with the same version of centos.

  • yum install spawn-fcgi worked for me though. =\
    – EJay
    Oct 15 '10 at 12:50
  • 2
    You may find you get better use out of PHP-FPM; PHP-FPM has been included in the PHP source code since 5.3.2. It negates the need for spawn-fcgi. I'm having a lot of success with it and Nginx. Jan 25 '11 at 10:21
  • Do note that FPM support is not enabled in RHEL's RPMs, so if you plan on having your distribution continue to provide security updates for your PHP version, stick with spawn-fcgi from EPEL. It works fine. Oct 6 '11 at 16:24

To solve this issue, I deleted /etc/sysconfig/spawn-fcgi

It appears to be working now.


Sorry, this is not the solution.

When installing php-cli it will install a php-fpm, not the original php-cli.

Remove all php packages yum remove php*and try to install the php53 binaries yum install php53*.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.