Can you suggest another language that effectively allows inline templating like PHP does, and has a huge set of libraries available?
PHP runs more of the "web" than you probably realise - some of the highest trafficked websites in the world, in fact. It's fine done properly. The bad press from 20 years ago is pretty much unwarranted these days. Also, if wordpress had been written in RoR or Perl/something else, plenty of the PHP bad press would have been avoided.