PHP is a joke, you can't seriously ask that question in 2014 "why not PHP?". There are 100000s websites about why it is a bad choice beside performance and security, you can easily look that up.
Why not Ruby/Python though?
I think about these languages as developing something quick, a prototype, demo sort of things and internal tools for limited number of users (<100 000). The performance is good enough for this range, and Sinatra/Django gives you great tooling around building a small web application (regardless if it is a UI or just an API). The memory management of these languages (especially the libraries) are not great, so sooner or later you gonna hit a barrier (just like several companies did, Opscode, Twitter etc.) That is the time when you need to think about something else, or the TCO will consume your revenue and it is simply not profitable to run your service.
I am kind of surprised that you see Java at the top and nothing else. My experience is that Java, Erlang (and more recently probably Go) sits at the top, when you are talking about programming languages for implementing a web application.
But why?
Java as a language does not really matter much, same goes to Erlang and Go as well. The more important part is the VM and the libraries you need to use for building a webapp. JVM has outstanding single node performance, with libraries like Jetty (last time I measured it was doing 7500 req/s with ~30ms p99 latency on my MBP out of the box) that gives you a great toolkit to implement a web application with amazing performance. Almost the same with Erlang, I think it still needs more community and better libraries, especially for more UI heavy apps, but on the other hand, the p100 latency is equal to p99 and p50 because of the per "process" (Erlang process, not operating system one) garbage collection. There is no global VM lock.
So, to answer your question, when Java? When you need good single node performance, you are expecting 1M+ users and you need to scale up your application with reasonable TCO. If you are more adventurous you can play with Erlang (build the next WhatsApp) or Go (and get the great support from the community and nice libraries from Google).
Personally I am using Compojure a lot with Jetty, and learning React (actually the Clojure port of it called Om). This gives me a sweet spot in terms of maturity, quick prototyping, lots of immutability and access to the most comprehensive library collection of the planet (LDAP, JDBC, you name it). I usually host my own stuff on AWS and company stuff is hosted in our DCs.