![]() |
Recompile PHP module
I have looked everywhere for instructions on how to recompile a PHP module. I currently have Marc Liyanages module but it wasn't compiled --with-mime-magic, so I need recompile it with that flag.
I have looked at the install pages at php.net which don't mention recompiling (nor is it mentioned on the entire site). I have searched Liyanages Site and his forums and I have searched the PHPBuilder Forums... Circles! Can anyone shed some light on this for me? |
The installation doc is:
http://www.php.net/manual/en/installation.php which has specific compilation instructions for each platform. |
It looks like Marc Liyanages build can't be reconfigured, so I have to download the latest build from php.net and compile it as closely as I can to Marcs' build.
I have some questions about this though... I don't know how to phrase a lot of my questions because I am very confused. I do know that I am very happy with the Liyanage build and would like to use the same libraries if possible. Everything in Marc's build is placed in /usr/local/php. When I uncompress the tar from php.net and run the configure file, I have to list all the libraries I want to compile it with... right? Can I use the libraries in my existing /usr/local/php directory? |
Well, I recompiled it using almost all of Marc Liyanages' configure flags adding --with-mime-magic and --enable-bcmath. Everything seemed to go okay, except that there are no differences in PHP. The phpinfo() page is identical to the way it was before I recompiled. There is no support for mime-magic or bcmath... When I configured it, I removed --with-pgsql and --with-mssql because they were causing problems... but the phpinfo() page still shows the configure command as it was in Marc's build... Also, the build date shows the original install date. Like I said, identical...
What steps should I take to find out what went wrong? I noticed that the only things that have been modified in my /usr/local/php directory are the following files in /usr/local/php/bin: phpextdist php-config php phpize I restarted Apache, and rebooted the computer, but still no changes. Is there something I need to change? Cache to delete? |
okay, I figured it out. I had to manually replace the old /usr/local/php/libphp4.so with the new /usr/libexec/httpd/libphp4.so. Now my changes are recognized.
:D Now I know how to compile PHP! For anyone who wants to know how to recompile PHP based on Marc Liyanages build, here are the basic steps: Step 1: download and install the latest build of PHP from Marc Liyanages site. Step 2: download and uncompress the latest PHP source from PHP.net Step 3: You can use most of the libraries in /usr/local/php/lib which were installed during Step 1. You can also configure PHP using nearly the same command Marc uses (look at the top of phpinfo() for this command). Just make sure all the libraries are in place (probably /usr/local/php/lib) and up-to-date. If you get an error while running ./configure, that a certain library is out of date, type sudo ranlib /path/to/libxxx.a where "libxxx.a" is the library that's out of date. Step 4a: If you want IMAP support: download the latest IMAP source into the same directory that you placed the uncompressed php-4.x.x source directory from step 2. Step 4b: enter the following into the terminal: Code:
tar -zxf imap-2002e.tar.ZCode:
./configure --prefix=/usr/local/php \Code:
sudo mv /usr/local/php/libphp4.so /usr/local/php/libphp4.so.oldCode:
sudo apachectl graceful |
|
| All times are GMT -5. The time now is 05:58 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.