|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40677 PHP crash when calling Java
Submitted: 2007-03-01 06:05 UTC Modified: 2008-07-18 00:19 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: poon dot fung at comcast dot net Assigned: edink (profile)
Status: Wont fix Package: Java related
PHP Version: 5.2.1 OS: windows xp
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: poon dot fung at comcast dot net
New email:
PHP Version: OS:


 [2007-03-01 06:05 UTC] poon dot fung at comcast dot net
Running the sample code in Java integration page causes PHP crash.

Reproduce code:
// 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('') . ' ' .
             $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'));

Expected result:
This result is produced by PHP v4.4.5.

can't open C:\j2sdk1.4.1_01\lib\tzmappings.
ZoneInfo: C:\j2sdk1.4.1_01\lib\zi\ZoneInfoMappings (The system cannot find the path specified)
ZoneInfo: C:\j2sdk1.4.1_01\lib\zi\ZoneInfoMappings (The system cannot find the path specified)
X-Powered-By: PHP/4.4.5
Content-type: text/html

Java version=1.4.1_01<br />Java vendor=Sun Microsystems Inc.<br />OS=Windows XP
5.1 on x86 <br />Thursday, March 01, 2007 at 5:57:08 AM Greenwich Mean Time

Actual result:
CLI has encountered a problem and needs to close.  We are sorry for the inconvenience.

AppName: php.exe	 AppVer:	 ModName: unknown
ModVer:	 Offset: 011edf24


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-01 08:15 UTC]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.

 [2007-03-02 21:16 UTC] valid at email dot address
This crash happens when you add the following to your php.ini


The php_java.dll from and the php_java.dll which is part of the official pecl for windows download crash the php executable.

Either remove the php_java.dll from the official pecl4win download or or fix this bug.
 [2007-03-05 09:49 UTC]
Edin, I'd prefer the former.
 [2007-03-05 16:00 UTC]
Short of deleting it from the CVS it is not possible atm.

Java extension is not maintained and probably does not work on any platform.
 [2007-03-05 17:26 UTC] poon dot fung at comcast dot net
I read in some discussions that PHP-Java Bridge is a replacement to PHP Java integration method. However, PHP-Java Bridge documentation shows only methods of calling from PHP to Java application server but not calling Java classes in-process. I would like to be able to call Java libraries from PHP.

If PHP Java integration were to be discontinued, manual page should be updated. I spent quite a bit of time trying to figure out why the integration did not work because there is no indication that it may not.
 [2007-03-06 16:03 UTC] peter_jones_jr at yahoo dot com

the documentation which comes with PHP clearly states that ext/java only works with some older versions of PHP4. I don't think ext/java is mentioned in the PHP manual page, at least not on debian.

Calling Java classes in-process is not possible unless you use a PHP implementation written in pure Java. For the Zend PHP engine you need an external Java process. I think this is what you mean with "Java application server".

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jun 12 13:01:22 2021 UTC