The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - General (http://hintsforums.macworld.com/forumdisplay.php?f=16)
-   -   Recompile PHP module (http://hintsforums.macworld.com/showthread.php?t=19745)

zeb 01-18-2004 02:01 PM

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?

hayne 01-18-2004 02:11 PM

The installation doc is:
http://www.php.net/manual/en/installation.php
which has specific compilation instructions for each platform.

zeb 01-18-2004 03:07 PM

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 01-22-2004 12:51 AM

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 01-22-2004 02:38 AM

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.Z
cd imap-2002e
make osx
ln -sf c-client include
ln -sf c-client lib
cd ..
cd php-4.x.x

Step 5: run the configure tool: (here are the flags I used broken into mulitple lines here for easy reading)
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

Step 6: You may need to overwrite the old "/usr/local/php/libphp4.so" with the new one located in "/usr/libexec/httpd/libphp4.so"
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

Step 7: restart apache:
Code:

sudo apachectl graceful

thanatas 01-07-2009 06:31 PM

http://www.pagebakers.nl/2008/12/17/.../#comment-4931

http://www.boutell.com/newfaq/creati...xtensions.html


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.