Quickly Re-configuring a Source-Based PHP Installation
Mar 12th, 2006 by Doug
‘–with-apxs=/usr/local/apache/bin/apxs’ ‘–with-xml’ ‘–with-mm’ ‘–enable-bcmath’ ‘–enable-calendar’ ‘–enable-ftp’ ‘–with-gd’ ‘–with-jpeg-dir=/usr/local’ ‘–with-png-dir=/usr’ ‘–with-xpm-dir=/usr/X11R6′ ‘–enable-magic-quotes’ ‘–with-mm’ ‘–with-mysql=/usr’ ‘–enable-discard-path’ ‘–with-pear’ ‘–enable-sockets’ ‘–enable-track-vars’ ‘–with-ttf’ ‘–with-freetype-dir=/usr’ ‘–enable-gd-native-ttf’ ‘–enable-versioning’ ‘–with-zip’ ‘–with-zlib’ ‘–with-mime-magic’ This is great, but doesn’t lend itself to copy-n-paste, with the extra quotes and characters present. A simple text filter will do nicely. The exact configure command to use as a base can be extracted with this:
php -i | grep Configure | sed -e “s/’//g” -e “s/^Conf.*=> //g”
(Note that there are two spaces after the =>) Here is what the output looks like: root@server [~/]# php -i | grep Configure | sed -e “s/’//g” -e “s/^Conf.*=> //g”./configure –with-apxs=/usr/local/apache/bin/apxs –with-xml –with-mm –enable-bcmath –enable-calendar –enable-ftp –with-gd –with-jpeg-dir=/usr/local –with-png-dir=/usr –with-xpm-dir=/usr/X11R6 –enable-magic-quotes –with-mm –with-mysql=/usr –enable-discard-path –with-pear –enable-sockets –enable-track-vars –with-ttf –with-freetype-dir=/usr –enable-gd-native-ttf –enable-versioning –with-zip –with-zlib –with-mime-magic
At this point, just copy-n-paste the line output by the filter to a command prompt, and just add the extensions you want to the end of the list, then hit enter (in this case, I added ‘ –with-curl –with-mcrypt’ to the end of the list). Then type ‘make’ - if there are no errors, type ‘make install’ and the new php shared library is now installed. Type ‘apachectl graceful’, or reload your Apache config some other way (this Apache was also installed from source, the binary packaged version of Apache can have its configuration reloaded on Red Hat with ’service httpd reload’), the new PHP modules should now be active and ready for use. Technorati Tags: PHP, Sysadmin, Howto![[SDF Public Access Unix System] [SDF Public Access Unix System]](http://www.unixlore.net/images/sdf.jpg)