The only way PHP and the other scripting languages scale like Java is by going to a shared-nothing sharded approach, vs. a typical clustered Java approach. However, none of them can touch Java when it is used in the same fashion.
Architecture can fix a lot of ills, but eventually at the high end (like Twitter, Facebook, etc) you'll reach a point where the increment of a faster language across your stack is no longer more expensive than just buying more machines.