Among that choice set, PHP is definitely the best contender.
I have a HTML page. How do I add a hit counter to it with Ruby?
I can do it right now in PHP with zero dependencies and it'll fit in this comment:
<html><body>
<p>You are visitor number:
<?php
$count = file_get_contents('hit_count.txt');
$count = $count + 1;
file_put_contents('hit_count.txt', $count);
echo $count;
?>
</p>
</body></html>
Is it shit? Yep. Does it (mostly) work? Yep.When you want to do something, you can just copy and paste a handful of lines of PHP into a file and rename it from .html to .php and it'll basically work anywhere. You don't need to worry about frameworks or anything. Routing is handled by the web server. Hosting is handled by someone else. Deploying is just FTP'ing a .php file off to a server somewhere and then requesting it.
But when you are ready to get into "real" programming, that's all there too. PHP has a true learning _curve_. Every bit of complexity is only a small step from the previous. Getting started does not require a ton of background or knowledge. You can start out copying and pasting some code into the middle of some HTML and a year later end up working within once of the nicer, more comprehensive frameworks managing your dependencies with a relatively decent package manager... and still hosting it all on your $3/mo shared hosting.
If every professional developer stopped using PHP tomorrow, we'd still end up back exactly where we are as a bunch of people found PHP as the most accessible and direct solution to the problem they have.
While with rails, to do basically anything, you already have a full db ready and incrementing a counter using the ORM is even easier than opening a text file. So people avoid PHP because it most likely involves dealing with absolute crap code written with no understanding.
can rails compete with the performance of octane using swoole with 8k reqs per sec?
rails is the first framework I ever learned in 2012 but I kept jumping back and forth until laravel basically started lapping rails in terms of baked in goodies.