php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14908 Unable to create Java Virtual Machine
Submitted: 2002-01-07 08:23 UTC Modified: 2008-07-23 01:00 UTC
Votes:30
Avg. Score:4.8 ± 0.6
Reproduced:25 of 25 (100.0%)
Same Version:13 (52.0%)
Same OS:19 (76.0%)
From: fusion at factmusic dot com Assigned:
Status: No Feedback Package: Java related
PHP Version: 4.1.1 OS: W2K
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-01-07 08:23 UTC] fusion at factmusic dot com
This has been mentioned many times before, but I'd like to keep the issue fresh.  I have tried everything I can think of but still eventually end up with the infamous "Unable to create Java Virtual Machine" after a successful run of a few minutes.  It seems that if I keep clicking it will keep running, but if I let it idle for a while then I get the lovely notification.

This is using the pre-compiled .ZIP file (manual installation) with Apache 1.3.22.  I doubt this makes a difference as I have seen this issue coming up on Linux as well as Win2K IIS systems.  I've also observed Win98 people expressing the same behavior.

I would LOVE to use this Java bridge feature - please tell me if and how it can be done - my partner is suggesting we move away from PHP - give me some fuel to stop that from happening!!

Malachi

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-24 06:19 UTC] yohgaki@php.net
Please test with  PHP 4.1.1+JDK 1.2 and report the result back 
Please do not forget  updating PHP version. Thanks.
 [2002-02-26 13:24 UTC] thiller at sandvine dot com
I am really looking for a fix to this problem.  Just playing with INI file settings doesn't seem to cut it.  I have noticed that if you set KEEPALIVE to off in Apache you can only access Java once (otherwise as long as you refreshed the page every few seconds it would keep working).  I think this problem has something to do with what happens when the module is unloaded.  It might be ending up in an unusable but loaded state which prevents it from being loaded again.  It is obvious it is web server independant.
 [2002-03-05 03:52 UTC] lilyprasad at hotmail dot com
With reference to the Bug:14908 from fusion@factmusic.com dated 7Jan, i would like to put following question as i am also facing the same problem:

Were you able to solve your problem!

We are also trying to install PHP4.1.1 with java spport having jdk version 1.2.2, linux 7.1, apache 1.3.19.

I also get the same error while testing a test php4 file having :

<?php

$obj = new Java ("java.lang.system") ;

?>

The error is Fatal error: Unable to create Java Virtual Machine in /var/www/html/test/test.php4.

[Java]
java.class.path = /var/www/php/php-4.1.1/ext/java/php_java.jar
java.home = /var/www/php/php-4.1.1/ext/java/jdk1.2.2:/var/www/php/php-4.1.1/ext/
java/jdk1.2.2/bin:/var/www/php/php-4.1.1/ext/java/jdk1.2.2/jre/bin:/var/www/php/
php-4.1.1/ext/java/jdk1.2.2/jre/lib
;java.library.path = /var/www/php/php-4.1.1/ext/java/jdk1.2.2/jre/lib/i386
;java.library = libjava.so
java.library.path = /var/www/php/php-4.1.1/ext/java/jdk1.2.2/jre/lib/i386/classi
c
java.library = libjvm.so
extension_dir = /usr/local/lib/php/extensions/no-debug-non-zts-20010901
extension = libphp_java.so
                                                                     
This is our present setting in the php.ini file.

Kindly help us.

With Regards,
Lily
 [2002-03-25 00:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2002-03-25 01:00 UTC] fusion at factmusic dot com
No, I have never been able to get this to work.  Maybe someone else can?
 [2002-03-26 11:31 UTC] ben at gostrategic dot com
I am receiving the following error using Win2k / Apache1.3.22 / PHP4.1.2 / JDK1.2.2 -- Unable to initalize Java Virtual Machine -- immediately after loading a script that uses Java.  I can remedy the problem by restarting Apache, which is obviously not feasible.
 [2007-08-15 13:55 UTC] patelbhupi at yahoo dot com
hello,
i need to know how to configure php with java,
Thanks in advance
 [2008-07-15 11:59 UTC] chandini882000 at yahoo dot com
Even i am facing the same problem.I am trying to call java from php.For this i am using PECL extension..and i also downloaded php java bridge.But the following test code:

$system = new Java('java.lang.System');	
// demonstrate property access
	echo "Java version=" . $system->getProperty('java.version') . "<br/>";

When i execute this i got the following error:
"Fatal error: java() [<a href='function.java'>function.java</a>]: Unable to create Java Virtual Machine"

In php.ini i added the following thing:
[java]
java.home="F:\Program Files\Java\jdk1.6.0_03"
java.class.path="C:\xampp\php\ext\JavaBridge.jar"
java.library.path="C:\wamp\php\ext"
java.library="F:\Program Files\Java\jdk1.6.0_03\jre\bin\server\jvm.dll"


Then my system started give an error that "Apache HTTP Server has encountered a problem and needs to close.  We are sorry for the inconvenience."..And can anyone help me out to solve this problem?

Chandini
 [2008-07-15 12:02 UTC] pajoye@php.net
If you use the PECL extension, report the bug there.

Please note that php 4.x will not get any non critical fix (security) until its very last release. Which PHP version do you use?
 [2008-07-23 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-09-25 13:46 UTC] asifimam at hotmail dot com
I am facing the same problem. Although it wortks fine on Windows, but it fails on linux. 
It fails only when it is being called through apache (web browser).
Else using php executable it passes. 
It fails on CreateJVM call.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Nov 24 21:01:23 2020 UTC