473,890 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why PHP is so much more popular for web-development

"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.

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.

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.

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.

All JMHO, of course.

Jul 25 '07 #1
31 4386
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.

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.

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.

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.

All JMHO, of course.
Indeed. The reason that PHP is so popular with so many people is that
the core language meets most of the simpler requirements for web sites.

Most people putting together a site are perfectly happy with something
along the lines of PHPNuke.

When someone starts to push the limits of PHP they either continue to
push until they get where they want to be (producing an ugly or
ill-maintained bunch of code along the way) or they choose a more
appropriate tool.

The latter behavior is typical of programmers. The former is typical of
typical users. There are many people producing web sites who I wouldn't
let within yards of any of my code. but it's some kind of tribute to PHP
that it manages to satisfy so many of them. This doesn't mean that
grafting PHP features into Python mindlessly will improve the language.

The Python approach is a scalpel, which can easily cut your fingers off.
The PHP approach is a shovel, which will do for many everyday tasks.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------

Jul 25 '07 #2
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.
Which is simply because they are preconfigured. If you have ever tried
to recompile a PHP installation because it misses e.g. oracle support.
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.

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.
I don't see that amongst the above is anything that python could learn.
Using turbogears, a simple

tg-admin quickstart

followed by a

../start-<projectname>.p y

is all you need. The templating system is simple, allows for embedded
python (to some extend, and a healthy one), database-support &
model-stuff is easy.

The cheap hosting and preconfigured apache setups are things that only
the market can solve.

Diez
Jul 25 '07 #3
Unfortunately, I also find that PHP programmers are usually more
plentiful than their Python counterparts. When thinking of staffing
an organization, it's common to target a skill set that's cheaper to
employ and easier to replace down the road if need be.

Also, larger hosting shops are hesitant to run things such as TG and
Rails that require an additional server process. The name of the game
is density. Sure, it may be easy to manage and run a TG project, but
it's a pain to set one up on a shared hosting server.

Lastly, I personally think it has something to do with the fact that
so many of the popular, free, web applications are PHP based. It's
easy for the average Web Administrator to get started with your
standard PHP package. From there, picking up the language is the next
logical step.

-Jeff

On 7/25/07, walterbyrd <wa********@ina me.comwrote:
"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.

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.

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.

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.

All JMHO, of course.

--
http://mail.python.org/mailman/listinfo/python-list
Jul 25 '07 #4
walterbyrd schrieb:
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.
Yes, indeed we can learn that popularity is not superiority. ;-)

Gregor
Jul 25 '07 #5


Steve Holden wrote:
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.

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'm primarily a sysadmin, and I provide web hosting-like services to a
community of developers who all want to do their own thing. An obvious,
clean way to do this has, so far, eluded me. Of course I could shove a
framework down the throats of my users, but if given the choice between
picking up a language, or picking up a language, and an accompanying
framework, which may or may not meet their needs, I think they'd pick
the former. In fact, in 6 years, we've never had anyone say "boy I wish
our web servers supported python". They've all been happily using PHP.

I'm in a relatively small shop. But think about an ISP. If you need to
support thousands of users who all have their own agendas, how exactly
do you support that with Python? This is not a rhetorical question - I'd
really like to know :)

In short, I don't think it's the language, but deploying it in a web
context that makes it less popular. If it were simpler, more ISPs might
do it, more users would find what they need with Python instead of PHP,
and it would become a more popular web language, IMHO.
The latter behavior is typical of programmers. The former is typical of
typical users. There are many people producing web sites who I wouldn't
let within yards of any of my code. but it's some kind of tribute to PHP
that it manages to satisfy so many of them. This doesn't mean that
grafting PHP features into Python mindlessly will improve the language.
I don't think anyone is saying the *language* itself needs improving. I
think there needs to be a cleaner, simpler, more practical way to deploy
Python as a generic web language instead of being forced to deploy it in
the context of some other framework. No ISP wants to impose the implied
limitations on their users, and the users would prefer not to have to
learn a framework.

Also, I just want to point out that in my discussions with other people
who consider themselves primarily Python coders, there are plenty of
them who still turn to PHP for web development. I got into Python for
systems programming (sysadmin tasks and network programming). If I need
to do web-based work, I'm likely to still use PHP because I have no idea
how to deploy/maintain/support Python on the systems end of the
equation. I'd love to be cured of that notion.

brian.
The Python approach is a scalpel, which can easily cut your fingers off.
The PHP approach is a shovel, which will do for many everyday tasks.

regards
Steve
--
Brian K. Jones
Python Magazine http://www.pythonmagazine.com
My Blog http://m0j0.wordpress.com
jonesy at pythonmagazine dot com

Jul 25 '07 #6
On Jul 25, 12:40 pm, Carsten Haese <cars...@uniqsy s.comwrote:
What exactly could Python learn from PHP?
Remember, I'm a noob, I'm not trolling.

When I posted "Python" I meant the Python web-developement world. In
particular, python frameworks, like CherryPy, have requirements that
are not realistic for most shared hosting plans.

Maybe I'm wrong, but I often get the idea that those who develop
python frameworks don't give a thought to the realities of shared
hosting. They seem to think that everybody has complete control over
the server. Things are very different in the PHP universe.

To use codeignitor as an example, again. On the "why codeignitor"
part of the welcome page you will find:

---
CodeIgniter is right for you if...
* You need broad compatibility with standard hosting accounts that run
a variety of PHP versions and configurations.
* You want a framework that requires nearly zero configuration.
* You want a framework that does not require you to use the command
line.
---

I don't seem to see Python frameworks using those sorts of selling
points. Posting as a noob, who is struggling to get django configured
on dreamhost, I gotta tell 'ya: those selling points look awfully
attractive.

The point is: PHP framework makers are very considerate of the
realities of shared hosting. Python framework makers don't seem to
give it a thought. Just maybe, that's something that Python could
learn from PHP.
Jul 25 '07 #7
On Wed, Jul 25, 2007 at 12:34:08PM -0700, walterbyrd wrote:
When I posted "Python" I meant the Python web-developement world. In
particular, python frameworks, like CherryPy, have requirements that
are not realistic for most shared hosting plans.
It's true that the requirements are higher than what the old-school
CGI/PHP web hosters offer. But with todays virtual root servers it's
really inexpensive to run such a server. And using frameworks allows you
to control all aspects of the web serving like URL dispatching, error
handling and is probably even faster than PHP because necessary
resources (like database connections) are initalized upon startup of the
web application. PHP and CGIs do this everytime they get called.
Maybe I'm wrong, but I often get the idea that those who develop
python frameworks don't give a thought to the realities of shared
hosting. They seem to think that everybody has complete control over
the server. Things are very different in the PHP universe.
Without wanting to sound arrogant: it's my belief that web hosters just
offering htdocs/PHP will probably just be useful for the noob-customers
who have no idea of operating systems but just want their blinking
personal homepage online.

There are good PHP applications and I wouldn't want to give up
phpmyadmin or squirrelmail. But with today's demand for fully
controllable interactive (you will never hear me propagate that bullshit
buzzword "Web x.0") web sites a framework seems to be a viable way.
For me PHP has a bitter taste of "easy enough for every noob to use it"
which makes it the language the most insecure applications are written
in.
The point is: PHP framework makers are very considerate of the
realities of shared hosting. Python framework makers don't seem to
give it a thought. Just maybe, that's something that Python could
learn from PHP.
Perhaps. But the hosting market changes. And I believe that PHP suits
the simpler applications better. I would point a beginner in web
programming more likely to PHP than torture them with frameworks. It's
just too heavy. OTOH full-featured frameworks are way more complicated
and have eviler requirements but there are hardly any limitation on the
kinds of sites you can power with them.

EO2¢

Cheers
Christoph

Jul 25 '07 #8
I'm an ex-PHP programmer (well, I still have to use some PHP at work,
but I don't tell anyone that at parties) who now uses Python or Lisp
wherever possible for web development. I can tell you exactly why PHP
is so popular: it acts as an extension of HTML and is syntactically
similar to Perl.

PHP mixes with HTML and removes the separation of model and view. It
has its roots in strictly procedural code (and its OO colors were
obviously painted on later), which is simple for non-programmers or
beginning programmers to understand. When considered from the
standpoint of a template language, it's a wonderful language. When
considered as a real programming environment, its limitations show.

PHP began as a series of Perl scripts. If you have ever looked at a
huge PHP project, it looks just as unreadable as a huge Perl project.
But there is a large number of programmers who began writing Perl-
based CGI for the web, and PHP was a very natural next step for them.
This is also a big reason why Ruby is popular among the same crowd
(...I say as I duck the inevitable flame war I've just started). Ruby
takes a lot of concepts from Perl and tries to make them work in an OO
framework (the ~ operator and the built in regex type, for instance).

I started with PHP for both of those reasons. Perl was becoming too
much of a chore and PHP offered a solution without learning a new
templating language: a way to embed perl code in the page itself.

Of course, now I am in recovery and am proceeding well with my 12
steps, thanks for asking.

Jul 25 '07 #9
On Wed, 2007-07-25 at 12:34 -0700, walterbyrd wrote:
On Jul 25, 12:40 pm, Carsten Haese <cars...@uniqsy s.comwrote:
What exactly could Python learn from PHP?

Remember, I'm a noob, I'm not trolling.
I know.
When I posted "Python" I meant the Python web-developement world. In
particular, python frameworks, like CherryPy, have requirements that
are not realistic for most shared hosting plans.
CherryPy is not a framework. Also, CherryPy's requirements are very
minimal. You either need a "vanilla" Apache/mod_python setup (which is
no harder to set up than a vanilla Apache/PHP setup), or just Python
itself if you use the webserver that is in CherryPy.
Maybe I'm wrong, but I often get the idea that those who develop
python frameworks don't give a thought to the realities of shared
hosting. They seem to think that everybody has complete control over
the server. Things are very different in the PHP universe.
Again, CherryPy is not a web programming framework. It is a web server
that "publishes" object methods.

Also, things are only easy in the PHP world if you only use the modules
that the hosting provider pre-installed. I doubt you'll easily find a
PHP hosting provider that will allow connections to Informix or Oracle
databases.
To use codeignitor as an example, again. On the "why codeignitor"
part of the welcome page you will find:

---
CodeIgniter is right for you if...
* You need broad compatibility with standard hosting accounts that run
a variety of PHP versions and configurations.
* You want a framework that requires nearly zero configuration.
* You want a framework that does not require you to use the command
line.
---

I don't seem to see Python frameworks using those sorts of selling
points. Posting as a noob, who is struggling to get django configured
on dreamhost, I gotta tell 'ya: those selling points look awfully
attractive.

The point is: PHP framework makers are very considerate of the
realities of shared hosting.
It may look like that to you, but that's not a property of the PHP
language. I haven't seen CodeIgniter, but I imagine it's easy for you to
set up because it's already installed by the hosting provider, which is
due to PHP's popularity. If you could find a provider that can give you
an out-of-the-box Django or TG set up, you'd probably find that just as
easy. Finding a hosting provider that'll do this is the problem, of
course, but that's not because these frameworks are designed to be hard
to install. It's just that most providers don't pre-install these
frameworks because there isn't enough demand.
Python framework makers don't seem to
give it a thought.
Python framework makers have no influence over what web hosting
providers do.
Just maybe, that's something that Python could
learn from PHP.
What is "that", and what can Python developers do to learn "that"?

--
Carsten Haese
http://informixdb.sourceforge.net
Jul 25 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1679
by: SC | last post by:
I'm trying to more accurately track visitors on one of my sites. Most of the visitors are from offices where they share an IP address. So, from one IP address, there might be 10 or more individual users. Instead of tracking unique IP addresses, I'd like to be able to track: the number of unique vistors per month the number of first time visitors (first time ever) per month and then page hits per month for each individual page as well...
16
2605
by: worzel | last post by:
is python more popular than coldfusion? I realsie that is a very general question as one thing does not directly relate to the other. My issue is that I am ditching coldfusion due to there being next to no work for it, and I am thinking of taking on python as a second language to java in the hope of improving my resume.
0
1314
by: UrsusMaximus | last post by:
One measurement by which Python is more popular than Ruby, Java, Perl, PHP and .NET is in the world of Podcasts. At Podcastalley, podcasts are ranked by popularity in each of several genre's. In the "Technology" genre there are 1026 podcasts listed and ranked, and of the ones that are about programming languages and related areas, they show up in the rankings like this: 32. Python411 44. Perlcast 49. ProPHP
1
918
by: yasmine | last post by:
hi ; I would like to ask according to the features of .net framework ,we can write application in any language. Suppose I have 2 web applications one written by VB.net and other by Visual C#,last web form in VB.net web application will be directed to 1st page in Visual C# web application. So we can make an empty solution and add in it 2 web applications,then in last web form in Vb.net web application redirect it to first webform in C#...
11
1405
by: cooltech77 | last post by:
hi all, I was curious to know as to which language is used more for the codebehind files in aspnet is it VB.net or C#?I want to prepare for certification and wanted to decide wehther i want to go for the vb.net track or C#. I like C# more than VB.net but I would like to know whats popular in the industry before making my choice. Thanks for your inputs in advance.
4
1509
by: ώε↮øй | last post by:
I have the whole group of .NET 2003 platforms sitting here from a dream I have of building some simple web based games (much like on msn zone) Any guidance as to where I start and what I need to learn to make even the simplest clone of checkers or other simple games? I'm completely lost in the ocean on where to start here thanks for the help
122
7962
by: seberino | last post by:
I'm interested in knowing which Python web framework is most like Ruby on Rails. I've heard of Subway and Django. Are there other Rails clones in Python land I don't know about? Which one has largest community/buzz about it?
1
1226
by: Karlo Lozovina | last post by:
I've been browsing what Python has to offer in the world of web programming for past few weeks, while preparing to select something for small, quick and dirty projects where my favorable solution, Zope3, is an overkill. There sure are handfull of solutions out there, but I didn't quite like any of them, starting from those with more of a framework approach (TG, Django, ...), and ending with really small ones, like Karrigell and Webpy....
3
1587
by: Tony Girgenti | last post by:
Hello. I'm new to all of this. I developed a web consuming windows application/form program with VS.NET 2003, VB, .Net Framework 1.1.4322, ASP.NET 1.1.4322, IIS 5.1. I started converting it to an ASP.NET Web Application because i thought it would be neater to have the explorer interface. However, it has become quite a learning experience trying to understand how
1
1266
by: WebDesignersIreland | last post by:
Some days back I was reading one article on web designing. The article was basically about learning the techniques for designing a search engine friendly web site. The words are as such: “Podcasts and videos are becoming more and more popular but as with all non-textual goodies as search engines can't read them, so if you don't have the tapescript of the podcast or the video, then the pod cast or video won’t have any value for search engine...
0
9978
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9819
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11222
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10810
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10918
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9625
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7169
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6041
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4674
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.