Generally integrating java and php together is not easy. There are other options some of which ray has suggested. Others include soap or writing out objects using the XMLEncoder class (1.4+) and decoding them with a parser in your php.
Panos Konstantinidis wrote:
Hello, I am completely new to PHP and due to some disparate components in our system I am trying to integrate PHP with Java. I have followed the instructions in the README file (under the ext/java folder in the PHP bundle) but I have hit a snag two days now.
I have done several changes in my php.ini file but none of them seems to work. Apache seems to be able to find the JVM butu nfortunatelly the page does not load.
With Opera 6.1 it just goes into a spastic fit and tries to connect and reconnect all the time (a problem similar to this URL: http://www.phpbuilder.com/annotate/message.php3?id=1014708.) with no error messages on the apache logs. If I use Netscape I just get the error message that the browser cannot load an empty document. If I use Mozilla it loads the page up fine but when I do view source it is an empty document (only the <html> and <body> tags are there, nothing else). I have tried every hack described on php.net and phpbuilder.com but to no avail, so you are my last hope.
Any ideas and recommendations are more than welcome.
Additional info:
php.ini: extension_dir=/usr/local/lib/php/extensions/no-debug-non-zts-20020429 extension=libphp_java.so java.class.path=/usr/local/apache/php/lib/php/php_java.jar java.home=/homa/panos/java/j2sdk1.4.0 java.library=/home/panos/java/j2sdk1.4.0/jre/lib/i386/server/libjvm.so java.library.path=/usr/local/lib/php/extensions/no-debug-non-zts-20020429
php file I am using for testing: <?php print "testing..."; $systemInfo = new Java("java.lang.System"); print "Total seconds since January 1, 1970:".$systemInfo->currentTimeMillis();
?>
os: Mandrake Linux 8.1 with kernel 2.4.8-26mdk php: 4.3.1 apache: 2.0.43 java: 1.4.0
Thank you.
__________________________________ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/
-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php