PHP have not worked (latest draft 2006), so maybe something has changed now. But overall, I still think that Java and actually typed languages (like Go, which was recently released) is better when developing large projects.
\r
When the language is typed, it is much easier to learn a third-party (and your) code or API. And in the IDE harder to make a mistake during coding.
\r
About libraries in PHP they are certainly a little bigger than Java (in web direction). But I solved this problem using RPC (not critical wastah) or using JNI (calling native C\\C++ functions through a special interface). On the other hand fundamental things like ORM or web framework made a lot more fluent.
\r
Quality made to manage dependencies, build and production of the project. Everything is automated and tuned for Java.
\r
In Java you have one process works with clients in PHP need for each client a new trial. I do not know how this affects the performance, but Java in this respect is easier to work with when writing some shared services to the customers.
\r
In the near future it will be possible to call Python, Ruby libraries or frameworks directly from Java. You can now to do it, but in Java7-8 it will be much optimized. So the problem with libraries is resolved.
\r
If you now want to start working with Java in the web, look at web frameworks Grails or Tapestry 5. The first is not quite Java (built on Groovy), but has a large number of integrations with libraries. The second entirely in Java, but less integrated libraries.
\r
Also Spring is now mainstream in the development of web projects. The above frameworks are either built on it or have the ability to integrate with it.