Search code examples
phpapachephp-java-bridge

Php java bridge Error : the procedure entry point php set error handling could not be located in dynamic link library C:\xampp\php\ext\php_java.dll


Integrating PHP java bridge, facing some issue while restarting Apache server as showing error:

The procedure entry point php set error handling could not be located in dynamic link library C:\xampp\php\ext\php_java.dll

I made the changes outlined below in my php.ini file and copied JavaBridge.jar and php_java.dll in C:\xampp\php\ext.

extension=php_java.dll

[java]
java.java_home = "C:\Program Files\Java\jdk1.8.0_131\bin"
java.java = "C:\Program Files\Java\jdk1.8.0_131\bin\javaw.exe"
java.class.path = "C:\xampp\php\ext\JavaBridge.jar"
java.library.path = "C:\xampp\php\ext"
java.log_level =2

Solution

  • Specific to your question:

    First of all, the javabridge communication is not handled anymore by a php extension (I mean the php_java.dll or java.so).

    So you simply don't need it, you can completly remove the "extension=php_java.dll" as this has been replaced by a pure php implementation known as the Java.inc client (or alternatively the soluble-japha client).

    I believe you use a very old documentation... So don't spend too much time in this direction because you'll probably won't have support.

    But if you want to work with the javabridge, just remember you'll have to install both:

    • a Java server that will expose the Java virtual machine on a network port (standalone or deployed on Tomcat)
    • a PHP client library on the PHP side that will establish communication with the server (Java.inc or soluble-japha)

    I suggest you to read the docs on the official php-java-bridge website to get some insights about installation (or alternatively some docs for the unofficial soluble-japha project, they work pretty much the same way).

    And first ensure, the php-java-bridge server is sucessfully running. The php-java-bridge files can be downloaded either:

    • Option 1: The war file (tomcat only) is here
    • Option 2: Individual files for cli/standalone server are here

    Once it works, try to connect from PHP.

    You'll probably face a lot of problems at first run, but from there it will be easier to answer your questions.

    Good luck