Bingo. In 2003 PHP was the best option to get from zero to hero.
I used PHP/MySQL too as it was just dead simple for most things.
They could have picked Perl CGI's and it'd still have happened (perhaps Perl 6 would be a success these days).
I don't think PHP has played any role in bringing FB to the size it is today (programming language does not translate to number of users signing up). So yes, any mainstream language available in 2003 would do it.
Also Perl libraries typically require superuser rights to install. That's a big deal if you're a poor student using shared hosting on your fun hacking projects.
Python really wasn't an option. mod_python by default required you to restart Apache whenever a python file changed. It was designed to be configured by sysadmins on dedicated servers... if you wanted something you could hack together an put on a shared host, it just wasn't an option.
Also the hot Python framework in 2003 was Zope. No one uses Zope anymore. For good reason.
Ruby was much smaller, and this was pre-rails so it didn't have any significant web framework. I'm not even sure if there was a production ready way of hosting ruby scripts.
I believe Perl probably would not have worked. It hasn't grown much as a web development language since then (although it has some great web frameworks). The language itself has languished in both development and community growth, and it fairly esoteric and certainly harder to learn than Python and PHP, and would have been harder to hire for. It seems unlikely that pre-2010 Facebook to meaningfully have changed the trajectory of the language (ie, Perl 6 being a success).
I don't think Java, C++ (or C), Cold Fusion, ASP, Haskell, Ocaml, and many other languages would have worked, for a bunch of reasons. Harder to hire for, harder to iterate with, more costly in terms of infrastructure, harder to teach/learn, and so forth.
PHP isn't a totally insignificant part of Facebook being as successful as it has been. A good-enough language choice was necessary, at least, and PHP it seems was a good-enough choice.
Of course this is vastly complicated if they been neglecting modularity and SOA for the past decade and most of facebook is still a monolith.....
Services (things like the feed, the typeahead, graph search, messages, &c.) are written in C++ and other languages - ie, the things it is sensible to write them in...