Hey folks,
Just got the bridge working on my Mac G5, thought I would post what I did,
building on the work of Alan Pinstein
(http://sourceforge.net/mailarchive/message.php?msg_id=13941505).
Hope it helps.
Clark
Installing php-java-bridge on Mac OS X (10.4.6) G5 PPC, from source.
Clark Freifeld
6 June 06
I have the following version of PHP installed on my Mac:
PHP Version 5.1.2 www.entropy.ch Release 1
It is available at
http://www.entropy.ch/software/macosx/php/
It is a module of Apache/1.3.33 (Darwin).
This installation is for php-java-bridge-3.1.0rc2.
1. libtool vs. glibtool
The bridge requires GNU libtool version 1.4.3 or higher, which exists on
MacOS 10.4.6 as glibtool. There is ANOTHER utility called libtool on the
Mac, which is NOT the right tool.
To solve this issue, make glibtool masquerade as libtool:
sudo mv /usr/bin/libtool ~/a.safe.tmp.dir
sudo ln -s /usr/bin/libtool /usr/bin/glibtool
This is TEMPORARY; you will need to undo it when we're done (see below).
2. PHP
For some reason, on my machine, I had two versions of PHP installed at
once: one in /usr/bin/php (php 4) and another in /usr/local/php5/. The
latter is the correct one. If you have both, you need to get rid of php4
and set your PATH variable accordingly.
What I did was to move the old php into a harmless directory.
Once you've done that, make sure your base PHP install still works, e.g.,
you can do a PHPINFO().
3. Extension dir
In your php.ini, set your extension_dir variable to a reasonable setting,
e.g. /usr/local/php5/lib. You may already have some extensions installed
so maybe you're already all set. On my machine, it was set to ./ by
default, which doesn't make a lot of sense.
4. Follow the installation instructions from the php-java-bridge Web site,
namely, download and extract the tarball, cd to the dir,
phpize && ./configure --with-java=$JAVA_HOME && make
sudo sh install.sh
<enter password>
Say No to all options presented by install.sh. (This way you separate the
JVM from the Web server as described in the php-java-bridge install docs.)
5. Set up php.ini config.
This is my config block for the php-java-bridge:
extension=java.so
[java]
java.log_level="3"
java.log_file="/var/log/php-java-bridge.log"
6. Launch the JVM
java -Djava.library.path=/usr/local/php5/lib -Djava.class.path=/usr/local/php5/lib/JavaBridge.jar -Djava.awt.headless=true -Dphp.java.bridge.base=/usr/local/php5/lib php.java.bridge.JavaBridge &
Replace /usr/local/php5/lib with your own extension_dir as set above in
Section 3.
7. Hope it worked
Copy the test.php file from the tarball directory to a Web accessible
directory. Along with the usual PHPINFO() stuff, you will see a block of
vars for the java extension, and then a bunch of debugging output at the
bottom of the page. You did it!
8. Move libtool back
sudo rm -i /usr/bin/libtool
sudo mv ~/my.safe.tmp.dir/libtool /usr/bin/libtool
|