PHP 4 supported an extension for combining PHP with Java, but to combine PHP with Java in PHP 5 or PHP 6 you should install the PHP/Java Bridge. In a Developer.com article on mixing PHP and Java, you will learn how to install and configure the PHP/Java Bridge and how to use Java classes in PHP scripts in a demo application.

Article link: Using PHP and Java in the Same App with PHP/Java Bridge