I observed that generally all good CMS, forums and portals are written in PHP only. Some of them are written with the help of Python, Ruby, etc.
Some of the CMS which were build in Java, were not so flexible as wordpress is. Is Java (Java EE) not good for building a wordpress like CMS?
I think the primary reason is that many CMS’s have grown from an initial small implementation instead of being designed from the start to be able to be big.
Small implementations are nice and easy to do in PHP or other scripting languages, and you can grow them pretty big, but if you know up front that you want something big you make it part of the original specification.
These days most people agree that you need a strong, fast, scalable runtime system where the major contenders these days are the JVM and the .NET runtime.
When you have made THAT decision, PHP is not the immediate, intuitive choice for a big scalable system.