Why PHP is so much more popular for web-development

Carsten Haese carsten at uniqsys.com
Wed Jul 25 20:40:27 CEST 2007

On Wed, 2007-07-25 at 10:42 -0700, walterbyrd wrote:
> "Once you start down the Dark path, forever will it dominate your
> desiny. Consume you, it will."
> - Yoda
> I'm fairly new to web-development, and I'm trying out different
> technologies. Some people wonder why PHP is so popular, when the
> language is flawed in so many ways. To me, it's obvious: it's because
> it's much easier to get started with PHP, and once somebody gets
> started with a particular language, that person is likely to stay with
> that language.

That's a major reason, yes.

> Before you can even get started with Python web-development, you have
> to understand this entire alphabit soup of: CGI, FASTCGI, MOD_PYTHON,
> FLUP, WSGI, PASTE, etc. For me, configuring fastcgi has been the most
> difficult part of getting django to work. PHP developers don't have to
> bother with anything like that. With PHP, you just throw some code in
> the middle of your html file.

I agree that there is a confusing number of choices, but you don't have
to understand them all to get started. You just need a pointer in the
right direction.

If you like PHP's way of plopping code into your HTML, take a look at
mod_python.psp. If you want to keep your logic and your presentation
separate, go with CherryPy and basically any template language you like.

> Also, PHP, and PHP frameworks, are supported everywhere. If you going
> to use a PHP MVC framework, like codeignitor, you would have a hard
> time finding a hoster that didn't support it - all you need is php4
> and mysql. Dollar-hosting, for $10 a year, should work just fine with
> codeignitor. With codeignitor, just copy your files to whatever host,
> and that's it, you're done.
> By contrast, the most popular Python frameworks have sky-high system
> requirements. Take a look at the requirements and/or recomendations
> for popular Python frameworks like Django, TurboGears, or CherryPy:
> Apache 2.0, mod_python (latest version), fastcgi (at least), command
> line access, PostgreSQL. And a lot of low-cost hosters don't support
> Python at all.

The comparison is not fair on many levels. PHP is not a framework like
Django or TG. You get a lot more stuff with Django or TG, so of course
the requirements are higher.

Seriously, take a closer look at CherryPy. With CherryPy, you don't even
need Apache since it provides its own web server.

The hosting problem is a vicious cycle. PHP hosting is easier to find
because PHP is more popular, and PHP is more popular (partly) because
hosting is easier to find.

> Don't get me wrong: I am not saying that PHP is better than Python for
> web-development. But, I sometimes think that Python could learn a few
> things from PHP.

What exactly could Python learn from PHP? PHP is a one-trick pony. It
was designed for web applications. People claim they write desktop
applications in PHP, but I don't believe them.

Python is more powerful and offers a lot more choices. In order for
Python to become more like PHP, somebody would have to make One True Way
of developing web applications in Python, and that's never going to

Just my two cents,

Carsten Haese

More information about the Python-list mailing list