Question about install support for python and php together

I get a vps host and install php already with spawn-fcgi.
And you could see my steps here:

Now I want to add support python ( in this host,
and try the steps in, but can’t work correct.
just get
spawn-fcgi: child exited with: 2

Who could tell me the steps I should do?

Many thanks,


The problem is that FCGI is a bag of crap and anything non-thread safe
will usually crash it. You either have a babysit it with something like
Monit, or use something more modern like uWSGI or Gunicorn. uWSGI is a
wsgi server written in C and needs to be compiled as well as requires a
compiled version of Nginx, although this is recommended anyway because
the Debian Aptitude version of Nginx is so damn old. Gunicorn is a 100%
wsgi server and shares many of the same benefits as uWSGI, but has not
been as fast in my tests. Either of these, your app will be the slow
part, not the wsgi server so it doesn’t matter.

Hope this helps.

On 06/05/2010 04:17, sagasw wrote:

Who could tell me the steps I should do?
I’ve personally had nothing but problems with spawn-fcgi and stopped
using it years ago. The -b switch for the php-cgi config tells PHP to
bind to an address:port, so you don’t really need spawn-fcgi as long as
something can keep an eye on the process.

We use supervisord to spawn & manage both PHP & Python services which
sit behind nginx. A supervisor config with something like the following
should get you going:

command=/usr/bin/php-cgi -c /etc/php.ini -b 8888


Then in your nginx config simply create a config file for each FCGI
environment (php/python) and add any “backends” (for python,
specifically) to your vhosts.

You can even use supervisord to start/manage your nginx instance. We
have supervisord manage everything, and have monit keeping an eye on
supervisord as an added bonus.

You can see more on supervisord at, however the
site is going through a server move at the moment so they’ve only got
the manual up at the moment.

Phillip B Oldham
[email protected] mailto:[email protected]


This e-mail and its attachments are intended for the above named
recipient(s) only and may be confidential. If they have come to you in
error, please reply to this e-mail and highlight the error. No action
should be taken regarding content, nor must you copy or show them to

This e-mail has been created in the knowledge that Internet e-mail is
not a 100% secure communications medium, and we have taken steps to
ensure that this e-mail and attachments are free from any virus. We must
advise that in keeping with good computing practice the recipient should
ensure they are completely virus free, and that you understand and
observe the lack of security when e-mailing us.