I don't think this is your normal NPE issue. Let me explain...
I have created a very simple PHP script to call a java class. Below is the code.
<?
error_reporting(E_ALL);
$wp = new java("com.worldpac.fulfillment.Fulfiller");
$result = $wp->initialize($host,$port,$uid,$pwd); // this is line 4
exit;
?>
Running Redhat 8 with Apache 1.3/PHP4.3.8 and Java1.4.2_05
When opening this through a web browser I get the NPE on line 4.
Now, if I just run the above script from the shell "php test.php" the program runs fine, no errors occur and I can actually talk to the class like normal.
I know that the $wp variable appears to be an object but is infact null, which is why the error is occurring. But why is it spitting back a null value only from a web browser and not the command line?
On the surface, it looks like it is a problem with communicating with the worldpac_fullment.jar archive, but this archive is in use on another webserver and functions correctly, I have even moved the JAR file from one the working server to the one not working with no change.
One more note, if this helps:
I can run any example from php.net (using the php_java.jar archive) from both a web browser and the command line. My php.ini file looks like below:
java.class.path = /usr/lib/php4/php_java.jar:/home/virtual/site6/fst/var/www/html/worldpac_fulfillment.jar
java.home = /usr/java/j2sdk1.4.2_05
java.library = /usr/java/j2sdk1.4.2_05/jre/lib/i386/libjava.so
java.library.path = /usr/lib/php4
extension_dir = /usr/lib/php4
extension = java.so
Thank you in advance for your help.