The assumption that migrating the entire www stack to something like C++ would help with the datacenter costs is not supported by reality. Please remember that the bits that are in PHP are mostly front-end code. This handles the presentation of the data, but the actual heavy-lifting and data manipulation is done by the back-end infrastructure which is mostly C/C++ with some Java thrown in for the hadoop bits.