让PHP 支持Java

[来源] 达内    [编辑] 达内   [时间]2012-10-26

PHP下如何部署PHP支持Java.想到之前有做过此项目.所以整理出Howto分享下.

看到社区有人提问@红薯 PHP下如何部署PHP支持Java.想到之前有做过此项目.所以整理出Howto分享下.

shell # vi /etc/apt/source.list
增加 deb http://archive.canonical.com/ubuntu maverick partner
shell # apt-get update
shell # apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk
shell #wget "http://jaist.dl.sourceforge.net/project/php-java-bridge/RHEL_FC%20SecurityEnhancedLinux/php-java-bridge_5.5.4.1/php-java-bridge_5.5.4.1.tar.gz"
shell # tar zxvf php-java-bridge-5.5.4.1.tar.gz
shell # cd php-java-bridge-5.5.4.1
shell # /usr/local/php/bin/phpize
shell # ./configure --disable-backend --with-java=/usr/lib/jvm/java-6-sun-1.6.0.24/ --with-php-config=/usr/local/php/bin/php-config
shell # make && make install
shell # vi /usr/local/php/etc/php.ini
### add java ###
[java]
java.socketname = 9267
java.servlet = On
java.java_home = /usr/lib/jvm/java-6-sun-1.6.0.24/
java.log_level = 2
java.java = /usr/lib/jvm/java-6-sun-1.6.0.24/bin/java
java.log_file=/var/log/php-java-bridge.log
java.classpath=/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/JavaBridge.jar
java.libpath=/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/

extension=java.so 

资源下载