[newbie] Equivalent to PHP?

Matej Cepl mcepl at redhat.com
Tue Jun 12 16:48:27 CEST 2012

On 12/06/12 11:39, Gilles wrote:
> I notice that Python-based solutions are usually built as long-running
> processes with their own web server (or can run in the back with eg.
> Nginx and be reached through eg. FastCGI/WSGI ) while PHP is simply a
> language to write scripts and requires a web server (short running
> processes).

I don't think it is a proper description of the situation (please, 
somebody correct my mistakes, I am not 100% sure about it myself). WSGI 
applications (which is basically all web applications in Python) could 
run in the hosted servers (using for example mod_wsgi for Apache), and I 
would expect that it is the situation with most production uses.

 From the programmer's point of view WSGI application (read 
http://en.wikipedia.org/wiki/Wsgi) is just one script which takes HTTP 
request on input and generates HTTP Response on output, so it is 
actually quite simple. And actually quite similar to what JSGI, PSGI, 
and Rake do (I am not sure who was first whether WSGI or Rake).

> anyway... why did Python solutions go for long-running processes while
> PHP was built from the start as short-running processes?

It is all about caching ... I am not sure how it  is done exactly, but I 
would expect for example mod_wsgi to cache parsed Python script in 
memory as well.


More information about the Python-list mailing list