PHP shines when you're trying to get a server-rendered web app off the ground. It's the VB6 of the web. Nothing else matches its development velocity, from keyboard to working code.
PHP shines when you're trying to get a server-rendered web app off the ground. It's the VB6 of the web. Nothing else matches its development velocity, from keyboard to working code.
But that's just not true.
All the things you mentioned are a yum/apt/nix/pacman/ install away on Linux, and probably as simple to install on macOS. I'm sure Windows has installers for these, too.
So, it's no harder to develop in them than it is in PHP.
You could argue it's cheaper because you don't have to pay for a shared hosting provider to host your files. However that's a bit moot since even back in the day there were LAMP stack Vagrantfiles that would automate this local setup.
Also, when speaking about dev velocity or time-to-start: you forgot JavaScript, which probably has much greater development velocity than anything else.
Furthermore, PHP is rarely just PHP in production. PHP also comes with various runtime modes (CGI, FPM, etc), .htaccess rules (or nginx equivalents), a bunch of runtime language and feature toggles that are partially controlled by the system (ie your hosting provider), and some can be controlled by the application.
The ephemeral process nature of the language makes some tasks very difficult to do in a performant way (but there's caching, so that's at least mitigated).
I've seen so many developers (worked for a hosting company) come complain to us about slow servers when in fact they'd just be doing silly stuff. And it was hard to blame them, because the language encourages that model, and the "performant" was was usually orders of magnitude more difficult to implement (ie indexing, image resizing, or most types of batch processing).
I'll not go into the horrors of how easy it is to mishandle file uploads in PHP (there's plenty of those around) and how many times people got easily hacked this way.
However, I think this recurring misconceptions how easy PHP is to develop in needs to stop. PHP comes with a lot of complexities. Worst kind of complexity to learn: hidden complexity.
I didn't mean to imply that other languages don't have complexities. All ecosystems come with their own boons and complexity issues (hidden or upfront). The thing I wanted to address is the general idea of "PHP is the simplest to develop in, it's just uploading a file" (paraphrasing) shouldn't be taken at face value, and that's why I pointed out some of the complexities when working with PHP that PHP developers tend to forget (or some ignore).
But, because PHP is so easy to get started with, a lot of the complexity initially gets hidden away, and sometimes people learn about it the hard way.
JavaScript used to be much the same, but it has gotten better in the recent years. Maybe PHP has gotten better in this aspect too, but I could be ignorant because I've not been keeping up with PHP as much
PHP makes it easy for beginners and amateur programmers to get something working without knowing much.
Because of the low-barrier to entry and simple hosting setup people have written a lot of crap PHP code over the years. I know, I see it and work with it.
Amateurs and well-meaning power-users can get some web pages up and running easier with PHP than with almost anything else, so while inexperienced programmers can write bad code in any language a large number of them choose PHP.
None of those facts mean PHP is not suitable for "real" development and "real" programmers. It is not obsolete or dying. A professional programmer who knows how to build production-quality web sites can get great results from PHP. That requires putting in the same time and effort needed to learn any other language and set of tools.
What's been useful about PHP (and many other stacks) is that the good ideas from other worlds usually get assimilated in over time. PHP is not always at the bleeding edge with respect to language development, but that's just fine. The PHP ecosystems often adopt/adapt useful ideas/techniques from other ecosystems relatively rapidly, and that's just fine too.
You're 100% right.
My original comment focuses on PHP because I was specifically addressing the "PHP is the easiest to develop in" idea.
I realise that it might seem a bit too critical maybe because PHP was the only topic in it, but I didn't mean it to come off like that. Hopefully I redeemed PHP a little bit in the follow-up comment! :D
At the end of the day: every ecosystem/language has its own "that shadowy place over there" :P
If we are talking about building large web applications then performance, maintainability and other things may start to be more important than fun and then c#, java, go and others can be really good solutions.
I'd rather say that this is actually one of the biggest selling points for PHP. Opcache and JIT works great, and reduces the overhead, but ironically, PHP is great for serverless applications.
I do a lot of work with PHP, both legacy and new code. The number one mistake I see with PHP sites set up by amateurs or cheap hosting services is running Apache+PHP on the same server as MySQL or Postgres. Separate those and performance and stability problems go away. That’s because relational databases consume as much memory as they can get, not because PHP is inherently slow or unstable.
You can't know everything. Programming is about abstraction; so abstracting away devops is a feature (in some contexts), lack of that is a downside (in some contexts).
Hosting (as a service, and shared hosting) is a very complicated business if you want to do it right.
Also, when picking hosting providers, there are many things that factor into this. Social, political, and economic status are one thing (of the dev and the client). Another thing that comes to mind is the client's (or sometimes even dev's) location/jurisdiction (or the website's audience).
The availability/locality plays a giant role in selection in non-western countries. For example, some European countries/ISPS have super-fast internet within them or up to the closest IX (internet exchange), but horrendous speeds towards anything beyond the IX; sometimes these are intentional (alas, curse politics) sometimes they're not.
We had many clients that would migrate to us because they had these issues with previous providers because we were different from other hosting providers.
Disclaimer: I used to work for a hosting company