Better error reporting when dll/shared library is not able to be loaded.

Submitted by: Bård Farstad <bf@ez.no>
This commit is contained in:
Sam Ruby 2000-08-17 10:14:50 +00:00
parent 1f793fd06c
commit d93732179b
5 changed files with 30 additions and 2 deletions

View File

@ -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 <jni.h>
#include <stdio.h>
@ -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;
}
}

View File

@ -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"

View File

@ -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 <jni.h>
#include <stdio.h>
@ -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;
}
}

View File

@ -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"

View File

@ -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"