PHP was pushed by the LAMP platform and that was pretty much the only language to make dynamic web sites in the 1990s and onto the 2000s. (The alternative would be CGI scripts if I remember well?)
Ruby only has some popularity in the silicon valley. Never heard of companies really adopting Ruby outside of there. It's open to debate whether it can qualify as one of the popular languages.