|
|
#1 |
|
Major Leaguer
Join Date: Dec 2002
Posts: 457
|
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?
__________________
..:: Zeb ::.. |
|
|
|
|
|
#2 |
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 32,473
|
The installation doc is:
http://www.php.net/manual/en/installation.php which has specific compilation instructions for each platform. |
|
|
|
|
|
#3 |
|
Major Leaguer
Join Date: Dec 2002
Posts: 457
|
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?
__________________
..:: Zeb ::.. |
|
|
|
|
|
#4 |
|
Major Leaguer
Join Date: Dec 2002
Posts: 457
|
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?
__________________
..:: Zeb ::.. |
|
|
|
|
|
#5 |
|
Major Leaguer
Join Date: Dec 2002
Posts: 457
|
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.
![]() 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.Z cd imap-2002e make osx ln -sf c-client include ln -sf c-client lib cd .. cd php-4.x.x Code:
./configure --prefix=/usr/local/php \ --with-config-file-path=/usr/local/php/lib \ --with-apxs \ --with-iconv=/usr/local/php \ --with-openssl=/usr \ --with-zlib=/usr \ --with-mysql \ --enable-cgi \ --with-gd \ --with-png-dir=/usr/local/php --with-freetype-dir=/usr/local/php \ --with-t1lib=/usr/local/php \ --with-jpeg-dir=/usr/local/php \ --with-tiff-dir=/usr/local/php \ --with-curl=/usr/local/php \ --with-mcal=/usr/local/php \ --with-mcrypt=/usr/local/php \ --with-mhash=/usr/local/php \ --with-pdflib=/usr/local/php \ --with-imap=../imap-2002e \ --with-imap-ssl=/usr \ --with-expat-dir=/usr/local/php \ --with-gettext=/usr/local/php \ --with-dom=/usr/local/php \ --with-dom-xslt=/usr/local/php \ --with-dom-exslt=/usr/local/php \ --with-xslt-sablot=/usr/local/php \ --enable-xslt \ --with-ldap \ --with-xmlrpc \ --with-xml \ --with-iodbc \ --enable-sockets \ --enable-dbx \ --enable-dbase \ --enable-trans-sid \ --enable-exif \ --enable-wddx \ --enable-ftp \ --enable-mbstring \ --with-mime-magic \ --enable-bcmath make sudo make install Code:
sudo mv /usr/local/php/libphp4.so /usr/local/php/libphp4.so.old sudo ln -s /usr/libexec/httpd/libphp4.so /usr/local/php/libphp4.so Code:
sudo apachectl graceful
__________________
..:: Zeb ::.. |
|
|
|
|
|
#6 |
|
Registered User
Join Date: Jan 2009
Posts: 1
|
|
|
|
|
![]() |
|
|