A workaround for a manual install of PHP 5.0.2 glitch
Nov 19, '04 09:18:00AM • Contributed by: worker201
Nov 19, '04 09:18:00AM • Contributed by: worker201
PHP 5 is out, and a binary installer is available for Panther. No Jaguar support is available. However, it is completely possible to install PHP on your Jaguar machine. In fact, you may have problems installing it in Panther, since there is a "misfeature" in the configuration file. Before you begin, make sure you have the Developer Tools and BSD subsystem installed and up to date.
One thing you must make sure you have is libxml2. You can use Fink, or install from source. If you use Fink, then xml2-config should be in /sw/bin. If you installed from source, then it should be in /usr/local/bin or /usr/bin. If it is in /usr/bin or /usr/local/bin, you should be fine; the configure script can handle these locations by itself. It's the Fink thing we have a problem with.
If you ask configure for help, by typing...
One thing you must make sure you have is libxml2. You can use Fink, or install from source. If you use Fink, then xml2-config should be in /sw/bin. If you installed from source, then it should be in /usr/local/bin or /usr/bin. If it is in /usr/bin or /usr/local/bin, you should be fine; the configure script can handle these locations by itself. It's the Fink thing we have a problem with.
If you ask configure for help, by typing...
./configure --help
... it will tell you that to define your own libxml location, you should add --with-libxml-dir=DIRNAME. This is standard Unix configure syntax. However, since we know that the xml2-config file is in /sw/bin, we might be tempted to run configure this way:
./configure --with-libxml-dir=/sw/bin
This is how every other configure script I have ever seen works -- if you give it a direct path, it uses it. But this is not how PHP does it. For some reason, the configure script adds a /bin to the directory you chose. So the configure script is now searching in /sw/bin/bin. Which doesn't (or shouldn't) exist. The fix is very simple:
./configure --with-libxml-dir=/sw
Let configure add its own /bin, and everyone is happy. It may seem like this is a trivial thing, and it is. But the only way to catch the problem is to open configure and look at lines 17934 and 17935. Which is what I did -- it was easy to fix after that. This is the first time I have seen a configure script like this. Normally, it would just search the path, and your path hopefully contains the Fink directory. By hardcoding in the search path, the developers have potentially confused a lot of people. Barring any other mishaps, you should be able to complete the installation by typing:
$ make
$ make install
Getting your Apache server to recognize it is another story altogether! Happy coding!
•
[4,134 views]
