Both technologies are used for dynamic websites development.
PHP is an interpreter based technology where as java is compiler based(usually JSP).
PHP is open source where as JSP is not.
Web sites developed in PHP are much more faster compared to Java technology
Java is a distributed technology, which means N tier application can be developed, where as PHP is used only for web development.