How complex is the website going to be? How many features are you able to get from existing scripts? Which do you already know? The simple answer is PHP but you'll need JavaScript with both as well as css. Any modern website is made up of multiple tools
If you're planning to sell that site in the future php is the way to go (more people know php than java).
Do you need to access hardware / strictly machine components? Then Java. If not, why the hell would you use Java, the most insecure programming language on the planet, which should never, ever be exposed to the Internet at all? PHP, hands down. Of course, if you're talking about JavaScript, not Java (which are two completely different things) the answer might be completely different.
Why would you say Java is insecure? It's all a matter of implementation, I've worked with JSP quite awhile back and it doesn't seem all that insecure to me.
If you website is complicated, I suggest to use Java because it's easier to maintain. PHP is real hard to maintain. One thing you can get benefit from PHP that the service doesn't down when you deploy an update like java (everytime you deploy a new war file, java web container need restart)
Lemme see... https://heimdalsecurity.com/blog/java-biggest-security-hole-your-computer/ http://www.zdnet.com/article/oracle-issues-emergency-java-patch/ https://en.wikipedia.org/wiki/Java_security And the fact that nearly every single Java-based application used on the Web have been retired for better, more secure (for the user, who doesn't need to have the Java-sdk installed) programs...
PHP. Btw it depends on task and application. If you going to built high-load web-site - you need to know about PHP limitations. PHP is great for simple or medium web applications, but incredibly bad for high-load. Java will be better, if you going to 100k+ requests in a hour.
There's a good chance that Popsicle doesn't program in Java to speak factually. It seems as if he is talking about Java Applets which to a degree I can agree with but that is a method of how you can run and use Java rather than an opinion of the language itself. Personally I think Java is fantastic for server side programming. I love the structure and power it has. However, personally, I would use PHP for most projects since I can develop it faster, like most people. But if I was looking at developing a very extensive extendable application requiring a high load I wouldn't use PHP. I would look at Java or C#. Most websites that require a programming language use that language for simple data validation, communicating with a database via sending/receiving data, and very simple text parsing and image manipulation. Any damn language can do that just fine. And most languages can handle a very high load without sitting down with a team of geeks to develop an infrastructure out of NASA's headquarters. By the time you ever need to recruit that dream team you should have some sort of business model to capitalize on your insane traffic. That's kind of why you don't see those types of questions on message boards.
It's not right to compare PHP to Java, since PHP is a server side scripting language while Java is a client side choice. Basically, the way they operate is different. But, mostly Java is great when development is complicated meanwhile PHP is great for nimble choice.
I had to google that - but apparently you can use java on the clientside http://www.javaworld.com/category/client-side-java/
I think you may be confused with Java clientsoftware (because that's what the links are about), they are known to have holes in their security and many browsers won't even use the websoftware anymore. In terms of security, Java based webservers are safe, because any potentially harmful code is not run on your computer and java has some good security libraries such as spring framework. Java is quite difficult to start with. PHP is easier, Python Django is even easier in my opinion.