Jump to content
Excelsior Forums
ONeil

Get Excelsior JET working with C++ and PHP

Recommended Posts

Hi,

I am evaluating JET to see if it will be a good fit to build our Saxon Java tool as a shared library for C++ which can be used as a extension in PHP.

So far I have managed to get the library built and working with C++, but I am hiting a problem in PHP, which I cannot resolve. I am getting the following error in the PHP log file:

FATAL ERROR: Unable to load /usr/local/jet8.0-eval-x86/profile1.6.0_43/jre/lib/i386/libjava.so (libjvm.so: cannot open shared object file: No such file or directory)

Does anyone know how to solve this problem or anyone have experience with working with excelsior JET and PHP?

Kind regards,

O'Neil

Share this post


Link to post
Share on other sites

I managed to solve the problem by copying libjvm.so to the directory /usr/lib

In the php code you will need the following setup of the LD_LIBRARY_PATH:

$saved = getenv("LD_LIBRARY_PATH");        // save old value
$newld = "<JET_HOME>/jre/lib/i386/jetvm:<JET_HOME>/lib/x86/shared";  // extra paths to add
if ($saved) { $newld .= ":$saved"; }           // append old paths if any
putenv("LD_LIBRARY_PATH=$newld");        // set new value

                       // mycommand is loaded using
                       // libs in the new path list
putenv("LD_LIBRARY_PATH=$saved");  

$saved = getenv("PATH");        // save old value
$newld = "<JET_HOME>/bin:<JET_HOME>/jre";  // extra paths to add
if ($saved) { $newld .= ":$saved"; }           // append old paths if any
putenv("PATH=$newld");        // set new value

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×