March 11, 2006
Note: This article was written after implementing Java (1.4.2_06) support on PHP 5.1.2 (cli) (built: Feb 28 2006 06:21:15)
As written on php.net there are two ways of integrating:
We will be talking about “Integrating Java into PHP”. This again can be done in two ways
Enabling php-java-bridge is fairly easy and recommended as you wont have to compile php which might be already customised.
This will install libraries in some folder eg /usr/lib/20050922 copy JavaBridge.jar java.so libnatcJavaBridge.so to php modules folder eg. /usr/lib/php/modules restart apache (service httpd restart) Look at out of phpinfo() and confirm that you see “java running” You can either write a php file and access it from your browser or quickly type echo ” | php | fgrep java at command prompt