Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web programming: Apache modules: mod_python vs mod_php

I've been using for more than 12 years PHP with Apache (a.k.a mod_php) for my web development work. I've recenlty discovered python and its real power (I still don't understand why this is not always the best product that becomes the most famous). I've just discovered mod_python for Apache. I've already googled but without success things like mod_python vs mod_php. I wanted to know the differences between the two mod_php and mod_python in terms of:

  • speed
  • productivity
  • maintainance (I know `python is most productive and maintainable language in the world, but is it the same for Web programming with Apache)
  • availability of features e.g, cookies and session handling, databases, protocols, etc.
like image 981
Olivier Pons Avatar asked Aug 29 '26 06:08

Olivier Pons


2 Answers

My understanding is that PHP was designed with Internet/Web in mind, but Python is for a more general purpose.

Now most people are leaving mod_python for mod_wsgi, which is more robust and flexible.

To answer other questions:

  • speed: python is faster. (PHP is slower than both ruby and python)
  • productivity: at least the same as php with numerous libraries
  • maintenance: python is clear and neat
  • features: more than you need, I would say.

Python was not popular on web because it wasn't focused on web at all. It has too many web frameworks (more frameworks than programming languages), so the community has not been as strong as Ruby on Rails.

like image 199
Dingle Avatar answered Aug 31 '26 03:08

Dingle


I wanted to know the differences between the two mod_php and mod_python...

PHP is more widely available on Internet hosts than Python.

I've noticed on one of my Python web sites that if I'm the first user to use Python, on that Internet host, the start up time of the Python services can be measured in minutes. Most people won't wait minutes for a web page to pop up.

Python has the same web features (cookies, session handling, database connections, protocols) as PHP.

like image 35
Gilbert Le Blanc Avatar answered Aug 31 '26 02:08

Gilbert Le Blanc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!