Written on November 06, 2008 at 05:11 pm by Sovit Tamrakar

Why is PHP Popular?

Why is PHP Popular?
PHP has been written from day one with hosting in mind. For a web hoster, it is very easy to deploy mass hosting servers with PHP on it, and they have done this on a very large scale. One german internet hoster at one point in time had a single 28 CPU SUN E6500 hosting more than 2 million domains on it. That’s two million more domains with PHP available, and simply because it is there, it is being used. Today in Germany you are hard pressed to find a hosting service at any scale or rate that does not offer PHP.

Same goes for MySQL: MySQL is a database server that was good enough for 80% of the market, and was optimized for a very small memory footprint. MySQL behaves well when deployed on the same machine as the web server, and it plays nicely with many logical databases on the same physical server.

Both PHP and MySQL quickly grew to include additional features that are advantageous in a shared hosting environment such as run time and memory limits or query rate limits.

Compare this to the average Java deployment environment and the requirements for such an environment, or try to construct a shared hosting deployment based on Java and, for example, Oracle.

The second very large factor working for PHP is the very flat initial learning curve. For many, PHP has been the first programming language, ever, just because it came with the hosting contract. And how do you write “Hello, world” in PHP?

Well, you create a HTML page containing the words “Hello, world”, and rename it to have a “.php” extension. The fact that every valid HTML page is also a valid PHP program means that PHP has zero initial learning curve.

From here, people start by adding simple PHP tags and exploring things. Just save from your web editor to your remote FTP location and reload in your browser. No compile-link-deploy cycles, no delays, just instant feedback. A simple “echo $currency*$rate” strategically inserted into a self-submitting form, and you have just written your first online currency converter. Three more commands, and you get $rate from a MySQL database. Simple things are easy in this world, and people can concentrate on understanding stuff instead of learning existing classes, frameworks and models.

This is how people learned with BASIC, and this is how they learn PHP. Using PHP, people solve their problems and learn things like “variables” and “control structures” on the fly by experiencing them and by experimenting with them. Other, more complex concepts such as dataflow and input validation, SQL, ER-models and normal forms, classes, inheritance and refactoring follow just as easily…

Widespread availability due to easily available shared hosting and a smooth learning curve combined with acceptable applicability to a wide range of problems is what made PHP the killer language of todays web.

One Response to “Why is PHP Popular?”

language learning software

June 7th, 2009 4:42 pm

You have a great blog here and it is Nice to read some well written posts that have some relevancy…keep up the good work ;)

Leave a Reply