One of the biggest reasons PHP supplanted Perl as the de facto web programming language ~10 years ago was that Perl running through CGI was incredibly slower than PHP.
One of the biggest reasons PHP supplanted Perl as the de facto web programming language ~10 years ago was that Perl running through CGI was incredibly slower than PHP.
mod_perl was spanking PHP 10 years ago from a performance standpoint, but the democratization of the web meant that a lot of people that started with basic HTML layout then learned to extend it with PHP in templates, then moved on from there. Much the same as Perl became a dominant CGI language in mid/late 90s because a lot of sysadmins and hackers transitioned to back-end development due to web programming demands.
I personally transitioned from writing Perl CGI scripts to writing PHP scripts about (pause while I look through my records) 9 years ago, and it was exclusively for performance reasons (I still prefer Perl as a language). I was not alone in my thinking back then.
- cruftyness of perl
- good timing, few alternatives (C and Perl basically) at a key point in the growth of the internet and web developers.
- very easy migration from a static only site
- easy to deploy, leading to...
- wide availability of PHP shared hosting
- in depth docs
- commenting on docs (cut-and-paste programming ;))
- thousands of builtin functions: first real batteries-included language
- recognizable syntax (esp vs Perl) for Java/C programmers
- not awful performance
- builtin MySQL support from an early stage
- oh, it was free (and also Free)
- dynamic typing
- weak typing (as in, values coerced to other types easily, I know this isn't a real term)
Very true and rarely mentioned. PHP docs never had the fancy wiki/social/javadoc features you see in many languages, just a primitive comments system - and it was perfect.
When you were picking it up back when "PHP3" yielded 0 results in Amazon (and we had to change the oil on our desktops every week) the docs were your bible, not merely in the sense of occasionally contradicted themselves but also in having examples, Q&A and recipes for common tasks posted by your peers in the comments, much faster than doc writers could catch up with the language's growth.
Two web language competitors to add here: MS .ASP and ColdFusion. PHP broke out by being both free and Free (the REPL helped too).
I don't know why mod_perl was known to very few and PHP become popular.
PHP sucked at the time too, but it sucked in ways that were easier to track down and fix.