In PHP, when an HTTP call is made, Apache, using the PHP, interpretes the 
> PHP file and sends the outcome. But python, an app needs to 
> be triggered with a specific port. Why is this so? I am not saying PHP is 
> better. I just want to understand the "how" python functions, 
> the fundamentals.


PHP and python behave very similar in this area, at least on the outside. 
There is no special port that you need to use with python. If you are 
referring to web2py's bundled web server's default port, than that's just a 
default setting, similar as you could have Apache running on some other 
port, not the default 80. There is absolutely no need to use web2py's 
bundled web server if you don't want to. It's just here for convenience.

In Apache PHP is usually executed trough mod_php, mod_fcgid or other 
similar module. Python can be executed trough mod_fcgid or, preferably, 
mod_wsgi. There are other ways, I'm just stating the most obvious.

I have never used the bundled web2py's server in production or even for 
development, just for limited testing. Based on my experience, I would 
advise deploying web2py with Apache or Nginx, although I'm sure other web 
servers could be sufficient, depending on your needs.

Reply via email to