Link to home
Start Free TrialLog in
Avatar of tvmccorm
tvmccorm

asked on

Problem installing php-java-bridge

My ultimate goal is to use apache 2.2 with tomcat 5.5 on freebsd 6.0 to speed up my app that uses php and java.  everything works untils I test the php-java bridge.  The error says:

Warning: dl() [function.dl]: java: Unable to initialize module Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20050922, debug=1, thread-safety=0
These options need to match
in /usr/local/www/apache22/data/test.php on line 15


There doesn't seem to be a freebsd port for the php-java-bridge, so I had to download/configure/make install.  I figure that the problem has to do with debug=1 vs. debug=0, but I can't figure out how to correct it.  I've spent an enormous number of hours trying to solve this one ...
Avatar of m1tk4
m1tk4
Flag of United States of America image

Are you building java as a shared module? Post your ./configure string here and apache version you are using.
Avatar of tvmccorm
tvmccorm

ASKER

Apache 2.2.0.  I'm not sure what you mean by 'building java as a shared module'.  I installed JDK 1.5 from the freebsd port with 'portinstall'.  That seems to work.  I think the problem is with the php-java-bridge I'm compiling by hand.  I just used:

configure --with-java=/usr/local/jdk1.5.0
are you building java bridge .so separately and then using it with a php module that was built at another time? If not, it sounds like a PHP build bug, I would take a look at bugs.php.net.
I see now it definitely is a php build bug.  It has nothing to do with java.  If I enter 'php' at the command prompt I get many lines like this:

PHP Warning:  PHP Startup: xmlreader: Unable to initialize module Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20050922, debug=1, thread-safety=0
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: xmlwriter: Unable to initialize module Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20050922, debug=1, thread-safety=0
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: mysql: Unable to initialize module Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20050922, debug=1, thread-safety=0
These options need to match
 in Unknown on line 0
php in realloc(): error: junk pointer, too high to make sense Abort (core dumped)

That API=20050922 seems to refer to ZEND?  I couldn't see anything at bugs.php.net ...  I did a 'portupgrade php-mysql' under /usr/ports/databases then a 'portupgrade php-extensions' under /usr/ports/lang
API version is basically a standard on how PHP communicates with the modules. If you build modules as shared binaries and try to load them later on, the API and parameters of the shared module must match that one of the main executive. Generally, this API stands the same for the same 2nd digit in the version, i.e. I can take a .so built for 4.3.8 and use it in 4.3.11, but the one built for 4.2 will most likely fail. However, the API matches, it's the debug options that are the problem.

Can you post a COMPLETE /configure command line?

What's the version of PHP your are building? I meant to ask this, not Apache ver.
It's php version 5.1.2.  I'm not using configure, I'm using portinstall.  But if I run phpinfo I see the configure it is using is:

configure' '--enable-versioning' '--enable-memory-limit' '--with-layout=GNU' '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all' '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-reflection' '--enable-spl' '--with-regex=php' '--disable-cli' '--with-apxs2=/usr/local/sbin/apxs' '--enable-debug' '--prefix=/usr/local' 'i386-portbld-freebsd6.0'  

Your can look at my phpinfo at:

http://65.101.139.204/phpinfo.php

I see I was wrong about 20050922, it refers to the php Extension ...
Can you try either telling portinstall to NOT do '--enaple-debug' or building PHP manually from the command line with the same configure options minus --enable-debug?
Unfortunately I haven't figured out how to override the configure arguments used by portinstall yet.  When I tried to manually 'configure/make install' it craps out at the end with 'junk pointer, too high to make sense Abort (core dumped)"
ASKER CERTIFIED SOLUTION
Avatar of m1tk4
m1tk4
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks m1tk4, that bug report did give me some clues.  In particular php 5.1.2 has a problem with --enable-versioning

That php-java bridge is still not working, but at least php is ...