You're right that the back-end often gets ported to some other language when a PHP app is scaled-up; this goes with my point that when you move away from spitting out web pages, another language is a better choice.
I'm not sure your point about a database is valid; Python and Ruby and Perl apps are all using a shared database (or newer k-v store) as well.