[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Problem installing php-java-bridge

Posted on 2006-04-19
10
Medium Priority
?
966 Views
Last Modified: 2013-12-13
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 ...
0
Comment
Question by:tvmccorm
  • 5
  • 5
10 Comments
 
LVL 15

Expert Comment

by:m1tk4
ID: 16494291
Are you building java as a shared module? Post your ./configure string here and apache version you are using.
0
 

Author Comment

by:tvmccorm
ID: 16494471
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
 
LVL 15

Expert Comment

by:m1tk4
ID: 16499931
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:tvmccorm
ID: 16500350
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
 
LVL 15

Expert Comment

by:m1tk4
ID: 16500537
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
 

Author Comment

by:tvmccorm
ID: 16500658
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
 
LVL 15

Expert Comment

by:m1tk4
ID: 16500724
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
 

Author Comment

by:tvmccorm
ID: 16500784
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
 
LVL 15

Accepted Solution

by:
m1tk4 earned 1500 total points
ID: 16500842
0
 

Author Comment

by:tvmccorm
ID: 16503257
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses
Course of the Month18 days, 18 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question