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 ...
tvmccormAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

m1tk4Commented:
Are you building java as a shared module? Post your ./configure string here and apache version you are using.
0
tvmccormAuthor Commented:
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
0
m1tk4Commented:
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.
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

tvmccormAuthor Commented:
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
0
m1tk4Commented:
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.
0
tvmccormAuthor Commented:
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 ...
0
m1tk4Commented:
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?
0
tvmccormAuthor Commented:
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)"
0
m1tk4Commented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tvmccormAuthor Commented:
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 ...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.