Unfortunately the common argument is not always true. To be honest at this point in time I would say PHP is actually the hardest to find hosting for. I'm a long time PHP developer and just recently tried Heroku out -- its like magic.
Best for generating web pages is a meaningless metric, and...
To be honest my main issue with PHP relates to the defense that "PHP is not as bad as people like to say.". I mean, really - its true. PHP5 is significantly better language than the previous versions, and people always over-exaggerate how bad it is. The problem is that PHP is not a good language.
Whenever I develop in Python/Ruby I actually enjoy the 'feel' of the language, and I'm often impressed by the power it has to do really complicated things in simple concise instructions. Most of the time when I'm working with PHP the feeling is very different. I can perform the same operations but generally theres far more cruft, and a couple manual lookups to see why functions behave differently when hashes ("arrays") have numeric indices (I'm looking at you array_merge!)
> PHP is actually the hardest to find hosting for.
What? No. Do you have any proof of this? I have yet to come across a "normal" shared/dedicated hosting service that doesn't support PHP. That is an insane statement.
The reason for that is because your definition of normal hosting is shared. (On a dedicated host you can run both PHP and Ruby; and they're roughly the same in terms of getting set up.)
In terms of actually finding website hosting for an application?
Saying PHP is the hardest was likely an over-exagguration, but the market for Heroku PaaS style hosting is growing massively and its Ruby runs on it very easily.
Its not hard (at all) to find hosting for either, the only reason in my mind PHP is harder is because of how beautifully PaaS works and that its free for small applications (good luck finding a reasonable free php host -- I know they exist but you'll have to dig through a whole lot of crud first)
The HN crowd is biased in favor of dedicated and virtual servers. But a very large number of mom-and-pop web pages and small business sites are still hosted on shared. That's what normal hosting means to a lot of people, and it's a market that developers of popular tools (like Drupal and WordPress) can't ignore.
Hosting isn't a very good metric in the first place. In a time where PaaS is going crazy and IaaS is crazy easy to find from tons of vendors, shared hosting is an out dated model that is only marginally a better option.
If you like Heroku, check out PhpFog.com or Orchestra.io. It's like magic too.
"PHP is not a good language" what is a good language?
To take your example, I do enjoy the feel of PHP, it feels natural to read to me, and after years of using it I rarely have to check the documentation for function behavior (such as array_merge...).
"...after years of using it I rarely have to check the documentation for function behavior (such as array_merge)."
This should not be something that takes years. I rarely have to check the documentation for similar Ruby functions after using it for only a couple months. After using PHP for 8 months straight, all day every day, I still had to look up almost every standard library function call - even if I thought I knew how it worked, I still had to check because the pervasive inconsistencies in the standard library ensured that I could never be confident in my guess.
(This is only the tip of the iceberg for why I don't like PHP and don't recommend people use it, for other reasons see: fatal errors vs. exceptions, the strange implementation of OOP (late static binding? isn't that an oxymoron?), and the numerous failing test cases / bugs that reveal themselves in every new release.)
Cheap, shared hosting used to be the greatest reason for staying withh php for me. But lately, I've been doing stuff that has required vps accounts, like rendering html to pdf or rendering pdf to png or powerpoint to pdf.
I realized I could just as well be using Erlang, as far as shared hosting support is concerned.
Now I'm thinking about switching to Python or Node. Or even Haskell.
That is not proper support for PHP, but they have had it in BETA for a while. Pagoda Box is the closest to Heroku around, it even does a lot of things much better.
" To be honest at this point in time I would say PHP is actually the hardest to find hosting for"
huh? Every VPS and shared hosting provider out there has PHP hosting.
"Whenever I develop in Python/Ruby I actually enjoy the 'feel' of the language,"
I use a language not because of its feel, but about what I can create with it. PHP is by far the easiest, most supported, and has a ton of real-world examples of sites getting millions of hits/day using it successfully.
"I can perform the same operations but generally theres far more cruft, and a couple manual lookups to see why functions behave differently when hashes ("arrays") have numeric indices (I'm looking at you array_merge!)"
I agree with you there. My one main gripe with PHP is inconsistent syntax/usage. However, I dislike frameworks like RoR because it is too high-level. I feel like I don't have enough power to do some customizations and when I do need to do them in something like RoR, I have to add hacks onto it.
// PHP is the easiest to find hosting for, to setup and to learn.
If you don't have PHP installed, it's probably the hardest to setup, much easier to install Java, Ruby (rvm), node.js.
To learn, the easiest language is the one you already know. I do believe PHP is a good language to start on if you have had no prior development knowledge, starting out with C like syntax is always a good idea, but certainly would like to thing complete newcomers would prefer the weaker more dynamic syntax of Ruby / Python.
Hosting wise, yes pretty much every server on the web hosts PHP, with the rise of platform as a service though, PHP lacks behind the other platforms offerings because of it's non-existant package management. PaaS is definitely getting a lot bigger, and takes all of the effort out of server administration, for newcomers I'd recommend PaaS, the learning curve for Sys admin is too high at the start. And in reality, heroku is one of the best offerings, just pushing up a Java app with a small dependencies file and everything gets installed for you, love to see PHP do that in the future, but in reality it just doesn't.
- PHP is still the best at generating web pages.
What?!
- PHP offers all the tools needed to build strong
applications (PHPUnit, xDebug, XHProf, ...)
Testing - PHP is probably the worst language I've ever written tests in, it is horrible compared to Ruby, Java, Node, Objective-C, C#. Other languages provider far better testing tools and debuggers. xDebug is horrible to setup compared to other languages where the debugger just works.
- PHP is not as bad as people like to say.
I agree with this point for sure, PHP 5.3 copes with most normal object oriented stuff, but so do all the other good languages for writing web applications, only the other languages have fantastic implementations, not "not as bad as people think" implementations. If this is one of your main points in recommending a language, that is shameful.
- PHP is still the best at generating web pages.
- PHP offers all the tools needed to build strong applications (PHPUnit, xDebug, XHProf, ...)
- PHP is not as bad as people like to say.
And I could go on for hours on why I (and others probably) stick to PHP.