Why PHP is so successful? Well...
"Shantytowns are usually built from common, inexpensive materials and simple tools. Shantytowns can be built using relatively unskilled labor. Even though the labor force is "unskilled" in the customary sense, the construction and maintenance of this sort of housing can be quite labor intensive. There is little specialization. Each housing unit is constructed and maintained primarily by its inhabitants, and each inhabitant must be a jack of all the necessary trades. There is little concern for infrastructure, since infrastructure requires coordination and capital, and specialized resources, equipment, and skills. There is little overall planning or regulation of growth. Shantytowns emerge where there is a need for housing, a surplus of unskilled labor, and a dearth of capital investment. Shantytowns fulfill an immediate, local need for housing by bringing available resources to bear on the problem. Loftier architectural goals are a luxury that has to wait."
It's also stateless - less rope to hang yourself with.
Many web programming environments started with the same simple CGI model, but eventually moved away chasing performance (for the computer), and leaving behind rapid feedback during development time.
hyperdev.com is nice, but it's still way more complicated than a single file PHP app.
That's its best feature and I love it.
It was then just a matter of uploading a few files via FTP to have a working website. .Net deployment, Java deployment were always more complicated and expensive. It was also easy for administrators to deploy Wordpress or Drupal, with next to no PHP knowledge whatsoever. That feature (ease of deployment) was often underestimated by other solutions, until the PAAS era.
Could PHP have been made better language wise while keeping the same features absolutely, but PHP was not taken seriously by people who could have fixed it early on.
Now as to why a facebook would use it? mindblown
PHP7 took a lot of great ideas from Hack but is still saddled with its legacy.
Never remember Facebook having much issue.