PHP without any doubt. Java for the web is still in use in banking sectors and the vast majority of Fortune 500 companies are using Java as the server side programming language.
Java and PHP are common as well as integral to modern web. But for beginners, PHP is the obvious choice because it requires less programming knowledge, more accessible to inexperienced users, flexible and fast.
PHP of course, it is the most supported and the most used language. Some programmers say that it is bad for large websites, but I don't think it is. Facebook is made with php.
Light Website, Blog, forum: PHP Complex or finance software: core-banking , ERP: Java Blockchain: Golang, C++ Crawler: PHP, python
As far as I know, Java is the more flexible language. It is better to prescribe large projects with this language. The choice depends on what you need.