I am intergrating php with java.
Fedora Core 3
php 5.1.4 - compiled from source
http 2.0.52-3 - installed by default in FC3
java jdk 1.5.0_07
I have compiled php-java-bridge-3.1 with java support without errors,
php.ini file has the following entry
extension = java.so
[Java]
I am following the steps given in http://php-java-bridge.sourceforge.net/INSTALL
The following command from the console gives "java running"
echo '<?php phpinfo() ?>' | php | fgrep java
But
wget -olog -O- http://localhost/phpinfo.php|fgrep java
does not give "java running" or does not show the java support.
In the browser
http://localhost/test.php
<?php
// get instance of Java class java.lang.System in PHP
$system = new Java('java.lang.System');
// demonstrate property access
echo 'Java version=' . $system->getProperty('java.version') . '<br />';
echo 'Java vendor=' . $system->getProperty('java.vendor') . '<br />';
echo 'OS=' . $system->getProperty('os.name') . ' ' .
$system->getProperty('os.version') . ' on ' .
$system->getProperty('os.arch') . ' <br />';
// java.util.Date example
$formatter = new Java('java.text.SimpleDateFormat',
"EEEE, MMMM dd, yyyy 'at' h:mm:ss a zzzz");
echo $formatter->format(new Java('java.util.Date'));
?>
gives the following error.
Fatal error: Class 'Java' not found in /var/www/html/test.php on line 3
Any dea?
Note: I have also tried with php-java-bridge-3.0.8.3, java j2sdk 1.4.2_12, php 4.3.9.