From: Jost B. <jos...@ya...> - 2005-11-05 12:46:04
|
Hi, a number of people have asked how to invoke php scripts from a java servlet or from a java application. Instead of answering these questions individually I have created a demo. The ~4MB linux tar file can be downloaded at -> php-java-bridge.sf.net/php-java-bridge-3.0-demo.tar It contains: * JavaBridge.jar version 3.0 * java.so version 3.0, intel/linux 386 binary * php version 5.0.5, intel/linux 386 binary * php-script.jar (new since version 3.0) * HelloWorld1.java: Allocates a script from the build-in CGI pool using a local FileReader, calls the local (CGI-) php continuation and invokes php script methods. * HelloWorld2.java: Allocates the script from an external HTTP pool using a URLReader, calls the remote php continuation and invokes php methods. For older java versions (<1.6) it also contains: * script-api.jar ((C) by Sanka Samaranayake, distributed under the Apache license) Extract the php-java-bridge-3.0-demo.tar in /tmp, for example with the command: cd /tmp tar xvf php-java-bridge-3.0-demo.tar And run the sample, for example with: sh runHello.sh To run the second demo, move the HelloWorld.php to your web server, make sure that the PHP/Java Bridge is installed on this web server and check that its php.ini contains _only_ the following entry: [java] # enable the http tunnel java.servlet=On After activating the new .ini (re-start the web-server), you can run the second example, which is similar to the first one except that it uses a URLReader to allocate and to call out to a php instance running on a remote http server. Regards, Jost Boekemeier ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de |