Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

PHP is popular because of low barrier to deploy. All hosting providers offer PHP, while with other technologies you'll have to shop a little.


Besides its ubiquity, it is also the only real contender that is specifically designed for the Web. You can just stick a PHP file containing `echo "1 + 1 is " . (1 + 1);` anywhere on your site and it will tell you 1 + 1 is 2. Ruby scripts (for example) can run that way, in practice a server will be set up to use a Rack interface instead of just echoing the output of a Ruby or ERb file. This simplicity is attractive to many who are just starting out.


Note that this kind of programming is deprecated even in PHP. In any reasonably well structured project, you'll find that kind of code only in templates, if at all.

From the article:

| Rasmus represents what most non-PHP developers hate about PHP.

| Rasmus generally promotes abstention from using frameworks, and the use of PHP as more of a templating language. To him, this translates to raw speed and scalability (load-wise). To everyone else, this translates to piles of procedural spaghetti code, and unmaintainable projects. For roughly 10 years following the birth of PHP in 1995, this was how PHP projects were written.


PHP + MySQL ended up being the VB+Access of the FOSS ecosystem.


Following that questionable logic, now that node.js is the latest hot fad, doesn't that make RoR the new PHP?


I don't think he is just talking about popularity, but about being popular, accessible to non-technical people and frowned upon by more competent techies. I think the comparison is quite apt, really.


This is very true.

Also it's worth noting that if you do want to do PHP "right" and use a framework like Zend or Cake you will probably still be shopping around a bit because you're not going to get the ability to use those frameworks out of the box on most hosting providers.


I've not really found this to be the case with Cake (which I like and use a fair bit) ... even if .htaccess is disabled for some reason, there is an alternate way to get it to run just fine ... generally though ... I can just put my cake file folder on the server and its good to go.

Thats huge.


There's plenty of hosting providers that provide ruby and python and all the rest. PHP because of ubiquity, I could see holding water 7 years ago, but not now.


But why do they offer it? Hardly anybody offers Java servlet hosting (for instance) and servlets are the superior technology for just about everything you would do with php.

The thing is that it isn't like say 30% of hosting providers offered it and it slowly got more and more, it was more like massive overnight 100% market penetration.

I've never met a hosting provider that didn't provide it, despite the fact that it is an absolute security nightmare.


I can tell you why Java is worse from hosting providers point of view: php is stateless by default, you can easily monitor resources used by php, while java servlets are stateful, they can use up a lot of resources and there are no easy to use available tools for hosting providers to monitor those resources Java can use. Java is designed to create applications to be deployed on multiple servers, not on a single server shared between a lot of users.


Interesting. Thanks for that.

I'm still puzzled about the nearly instantaneous and complete market penetration of php.


Back then there were almost no competition.


Ease of deployment might be why this very blog post is published on Wordpress.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: