I've done apps both in php and in Java and if the app is small it's much more difficult to deploy a Java application than php application.
Most Java deployments are persistent (there is an application in memory which answers requests) and it is prone to memory (or other resource) leaks, while php is widely adopted in shared hosting environment because of its statelessness, even if there is a possible memory leak - in most cases it's not important, only long processing queries might bring it up in php, and it is solved by hosting providers with putting limits to http time.