UPDATE: read carefully before you vote, this is not my approach to PHP/Java, I'm trying to see how his teacher sees the PHP/Java thing. Thanks.
What I think your teacher thought: PHP is a language which is locked inside a webserver, mostly used to generate web pages.
Java, on the other hand, is a general-purpose language used for web pages too but used in other industries like microwaves & cars, you can write desktop application in Java etc.
With this in mind it's understandable why your teached said "PHP isn't a real programming language!"
I'm not biased, I don't like both, Java & PHP :) ...but have to use them both