php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16770 get Fatal error: Cannot instantiate non-existent class when running simple test
Submitted: 2002-04-23 16:57 UTC Modified: 2002-09-26 20:07 UTC
Votes:20
Avg. Score:4.6 ± 0.7
Reproduced:19 of 19 (100.0%)
Same Version:6 (31.6%)
Same OS:5 (26.3%)
From: PLancashire at Columbia dot com Assigned:
Status: No Feedback Package: Java related
PHP Version: 4.0CVS-2002-04-23 OS: Solaris 2.8
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-04-23 16:57 UTC] PLancashire at Columbia dot com
---Environment------------------------------------
Solaris Sparc 2.8 Patchkit as of 5/Apr/2002
Gcc 3.0.3 (Sunfreeware)
binutils 2.11.2 (Sunfreeware)
GNU Make version 3.79.1 (Sunfreeware)
GNU libtool 1.4 (1.920 2001/04/24 23:26:18) (Sunfreeware)
java j2sdk1.4.0
Zlib 1.1.4 (source)
php 4.1.2

PATH includes /usr/j2sdk1.4.0/bin
JAVA_HOME /usr/j2sdk1.4.0
---------------------------------------------------

---configure---------------------------------------
./configure \
--with-apxs=/usr/local/apache/bin/apxs \
--with-config-file-path=/usr/local/apache/httpd/conf \
--without-mysql \
--with-zlib-dir=/usr/local \
--with-zlib=/usr/local \
--with-java=/usr/j2sdk1.4.0
---------------------------------------------------

---[php.ini]---------------------------------------
[Java]
java.home=/usr/j2sdk1.4.0
java.library.path=/usr/local/php/lib
java.library=/usr/j2sdk1.4.0/jre/lib/sparcv9/libjava.so
;have also tried
;java.library=/usr/j2sdk1.4.0/jre/lib/sparcv9/server/libjvm.so
;java.library=/usr/j2sdk1.4.0/jre/lib/sparc/libjvm.so
java.class.path=/usr/local/php/lib/php_java.jar
extension_dir=/usr/local/lib/php/extensions
extension=java.so
----------------------------------------------------

---php code-----------------------------------------
<head>
<title>Test Page for PHP/Java</title>
</head>
<?php
      $system_inst = new Java('java.lang.System');

      // Test PHP's ability to get a property from a Java class
      echo "The version of Java running is";
      $system_inst->getProperty("java.version") ;
?>
</body>
</html>
----------------------------------------------------

---error message------------------------------------
Fatal error: Cannot instantiate non-existent class: java in /usr/local/apache/htdocs/php_java.php on line 6
-----------------------------------------------------

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-23 16:58 UTC] PLancashire at Columbia dot com
correct Summary line
 [2002-09-09 10:32 UTC] kalowsky@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip

I believe this isn't a bug, and a case of php.ini's being wrong.  But in either case, I've borked around in the ext/java code a bit too.... test it out if you can.
 [2002-09-26 20:07 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2002-11-11 10:07 UTC] andi at rc dot austria dot hp dot com
Hello everybody,

it seems that i got the same error/bug on HP-UX 11.11

   Invoking Java...
   Fatal error: Cannot instantiate non-existent class: java in
   /opt/apache-1.3.27/htdocs/testjava.php on line 5
   First i was using php 4.2.2 after reading the conclusion of bug 16770 i
   upgraded to 4.2.3 but got the same error message.
   #######################
   My environment:
   HP-UX 11.11
   HP-UX C compiler
   java j2sdk1.4. (provided by hp.com/go/java)
   php 4.2.3
   zlib-1.1.4
   #######################
   testfile:
   more /opt/apache-1.3.27/htdocs/testjava.php
   <?php

   print "Invoking Java...";

   $systemInfo = new Java("java.lang.System");

   print "Java initialized.";

   print "Total seconds since January 1, 1970:
   ".$systemInfo->currentTimeMillis();

   ?>
   #######################
   php.ini:
   [Java]
   java.class.path = /opt/php-4.2.3/lib/php/php_java.jar/php_java.jar
   java.home = /opt/java1.4
   java.library = /opt/java1.4/jre/lib/PA_RISC/libjava.sl
   java.library.path = /opt/java1.4/jre/lib/PA_RISC
   extension_dir=/usr/local/lib/php/extensions/no-debug-non-zts-2002042
   extension=java.a
   #######################
   php config:
   ./configure --prefix=/opt/php-4.2.3 --with-zlib=/opt/zlib-1.1.4
   --enable-mbstring --enable-mbregex --enable-cli -
   -with-java=/opt/java1.4 --without-mysql --without-libmysql
   --with-apache=/opt/apache_1.3.27
   #######################
   apache config:
   ./configure --prefix=/opt/apache-1.3.27
   --add-module=./src/modules/standard/mod_vhost_alias.c
   --add-module=./src/
   modules/standard/mod_env.c
   --add-module=./src/modules/standard/mod_log_config.c
   --add-module=./src/modules/standa
   rd/mod_mime_magic.c
   --add-module=./src/modules/standard/mod_negotiation.c
   --add-module=./src/modules/standard/mod
   _status.c --add-module=./src/modules/standard/mod_info.c
   --add-module=./src/modules/standard/mod_include.c --add-
   module=./src/modules/standard/mod_autoindex.c
   --add-module=./src/modules/standard/mod_dir.c --add-module=./src/mo
   dules/standard/mod_cgi.c --add-module=./src/modules/standard/mod_asis.c
   --add-module=./src/modules/standard/mod_i
   map.c --add-module=./src/modules/standard/mod_actions.c
   --add-module=./src/modules/standard/mod_speling.c --add-m
   odule=./src/modules/standard/mod_userdir.c
   --add-module=./src/modules/standard/mod_alias.c --add-module=./src/mod
   ules/standard/mod_access.c
   --add-module=./src/modules/standard/mod_auth.c
   --add-module=./src/modules/standard/mod
   _auth_anon.c --add-module=./src/modules/standard/mod_auth_dbm.c
   --add-module=./src/modules/standard/mod_digest.c
   --add-module=./src/modules/standard/mod_cern_meta.c
   --add-module=./src/modules/standard/mod_expires.c --add-modul
   e=./src/modules/standard/mod_headers.c
   --add-module=./src/modules/standard/mod_usertrack.c
   --add-module=./src/mod
   ules/standard/mod_unique_id.c
   --add-module=./src/modules/standard/mod_setenvif.c
   --activate-module=src/modules/ph
   p4/libphp4.a

   Thanks in advance for your support,
   Andi Monari
 [2007-04-26 10:13 UTC] irfan_zone at yahoo dot com
Fatal error: Cannot instantiate non-existent class: box in
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Nov 24 04:01:23 2020 UTC