From d93732179bfe4986a54f84970e05a887475a5ce8 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Thu, 17 Aug 2000 10:14:50 +0000 Subject: [PATCH] =?utf8?q?Better=20error=20reporting=20when=20dll/shared?= =?utf8?q?=20library=20is=20not=20able=20to=20be=20loaded.=20Submitted=20b?= =?utf8?q?y:=20B=C3=A5rd=20Farstad=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- ext/java/java.c | 10 +++++++++- ext/java/java.dsp | 4 ++++ ext/rpc/java/java.c | 10 +++++++++- ext/rpc/java/java.dsp | 4 ++++ sapi/servlet/servlet.dsp | 4 ++++ 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/ext/java/java.c b/ext/java/java.c index ed78777e77..6bb0aaa2d0 100644 --- a/ext/java/java.c +++ b/ext/java/java.c @@ -29,6 +29,13 @@ #include "php_ini.h" #include "php_globals.h" +#ifdef PHP_WIN32 + #include "win32/winutil.h" + #define DL_ERROR php_win_err() +#else + #define DL_ERROR dlerror() +#endif + #include #include @@ -185,7 +192,8 @@ static int jvm_create() { dl_handle = DL_LOAD(javalib); if (!dl_handle) { - php_error(E_ERROR, "Unable to load Java Library %s", javalib); + php_error(E_ERROR, "Unable to load Java Library %s, error: %s", + javalib, DL_ERROR); return -1; } } diff --git a/ext/java/java.dsp b/ext/java/java.dsp index 2cc1633245..6c33f4e0e3 100644 --- a/ext/java/java.dsp +++ b/ext/java/java.dsp @@ -150,6 +150,10 @@ LINK32=link.exe SOURCE=.\java.c # End Source File +# Begin Source File + +SOURCE=.\..\..\win32\winutil.c +# End Source File # End Group # Begin Group "Header Files" diff --git a/ext/rpc/java/java.c b/ext/rpc/java/java.c index ed78777e77..6bb0aaa2d0 100644 --- a/ext/rpc/java/java.c +++ b/ext/rpc/java/java.c @@ -29,6 +29,13 @@ #include "php_ini.h" #include "php_globals.h" +#ifdef PHP_WIN32 + #include "win32/winutil.h" + #define DL_ERROR php_win_err() +#else + #define DL_ERROR dlerror() +#endif + #include #include @@ -185,7 +192,8 @@ static int jvm_create() { dl_handle = DL_LOAD(javalib); if (!dl_handle) { - php_error(E_ERROR, "Unable to load Java Library %s", javalib); + php_error(E_ERROR, "Unable to load Java Library %s, error: %s", + javalib, DL_ERROR); return -1; } } diff --git a/ext/rpc/java/java.dsp b/ext/rpc/java/java.dsp index 2cc1633245..6c33f4e0e3 100644 --- a/ext/rpc/java/java.dsp +++ b/ext/rpc/java/java.dsp @@ -150,6 +150,10 @@ LINK32=link.exe SOURCE=.\java.c # End Source File +# Begin Source File + +SOURCE=.\..\..\win32\winutil.c +# End Source File # End Group # Begin Group "Header Files" diff --git a/sapi/servlet/servlet.dsp b/sapi/servlet/servlet.dsp index 77654a69f8..648e9be3ec 100644 --- a/sapi/servlet/servlet.dsp +++ b/sapi/servlet/servlet.dsp @@ -154,6 +154,10 @@ SOURCE=..\..\ext\java\java.c SOURCE=.\servlet.c # End Source File +# Begin Source File + +SOURCE=.\..\..\win32\winutil.c +# End Source File # End Group # Begin Group "Header Files" -- 2.40.0