This week's book giveaways are in the Refactoring and Agile forums. We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line! See this thread and this one for details.
I think that choosing one over the other based on just this would be the wrong thing to do. I'd prefer to say: which suites you better? Personally I like Java and application servers have some handy features built in for managing authentication and sessions, but PHP has a range of useful tools too.