I saw this post on Sitepoint quoting a statement by Rasmus Lerdorf which goes (according to Sitepoint) as follows:
How can you make PHP fast? Well, yo
Don't even bother. PHP is slow... You may create a mixture of C++ and PHP but you'll need to do lots of profiling to understand what is slow. And this is mostly... PHP.
See following:
Just write in C++ in first place. It is as simple as writing in PHP with modern C++ web framework and good knowledge in C++.
Where to start: