Install php from source – custom path

Sunday, December 13th, 2009 | Linux

Hey guys,

Recently I wanted to give php 5.3.1 a go but without interferring with my current setup, so I choosed to run it as fcgi.
In order to do that I wanted to compile php from source, enabling the modules I needed (gd with jpg support), bmath, pdo, pdo_mysql (for magento) and so on

here we go:
1. go to php site and download your version
2. upload to your server and unarchive it somewhere :)
3. go using putty or something similar to where are the files extracted, enter the source directory
4. I used this command, change it per your needs:
./configure –enable-bcmath –enable-calendar –enable-fastcgi –disable-cli –enable-ftp –enable-gd-native-ttf –enable-libxml –enable-magic-quotes –enable-mbstring –enable-soap –enable-sockets –prefix=/usr/local/php-5.2.13-fcgi –with-curl=/opt/curlssl/ –with-jpeg-dir=/usr/lib –with-jpeg –with-png-dir=/usr/lib –with-libdir=lib64 –with-gd –with-mm –with-mcrypt=/opt/libmcrypt/ –with-mysql=/usr –with-mysql-sock=/var/lib/mysql/mysql.sock –with-mysqli=/usr/bin/mysql_config –with-openssl=/usr –with-openssl-dir=/usr –with-zlib –with-zlib-dir=/usr –enable-pdo –with-pdo-sqlite –with-sqlite –with-pdo-mysql=/usr –with-pdo-sqlite –enable-zend-multibyte –with-freetype-dir=/usr –with-gettext –with-ttf –enable-force-cgi-redirect –enable-sysvsem –enable-sysvshm
5. make
6. make install

make sure you rename and copy the development php.ini to the lib/php.ini

No comments yet.

Leave a comment