I love yum!! But I also hate how you can’t install previous version of software sometime.
Because of Zend dependency and PHP 5.2.x I recently hit a problem where I couldn’t install it via yum. All yum repo’s only had PHP 5.3.x . I specifically need 5.2.10+. Not only that, I needed extensions like gd, soap, mbstring, mhash, mcrypt extra. Anyway, after a lot of trial and error, I finally got it working. Here are my list of commands (For a 64-bit Centos).
- Get PHP source from http://www.php.net/downloads.php
- Untar and go into directory
tar -xvf php-5.2.13.tar ; cd php-5.2.13
- You can just compile with
./configure '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--with-t1lib=/usr' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--with-mime-magic=/usr/share/file/magic' '--with-apxs2=/usr/sbin/apxs' '--enable-soap' '--with-gd' '--enable-dom' '--disable-dba' '--without-unixODBC' '--enable-pdo' '--enable-xmlreader' '--enable-xmlwriter' '--without-sqlite' '--enable-json' '--without-pspell' '--enable-wddx' '--with-curl' '--enable-mbstring=all' '--disable-posix' '--disable-sysvmsg' '--disable-sysvshm' '--disable-sysvsem' '--with-mcrypt' '--with-mhash' '--with-mysql' '--enable-mysqli' '--with-mysqli=/usr/bin/mysql_config' '--with-pdo-mysql=/usr/bin/mysql_config' '--with-xsl' '--with-zip'
- However you will find that lot of libraries are not there
. Anyway, these are the list of items you require
yum install -y mod_ssl.x86_64
yum install -y openssl-devel.x86_64
yum install -y crypto-utils.x86_64
yum install -y gcc
yum install -y make
yum install -y perl
yum install -y httpd-devel
yum install -y libxml2-devel.x86_64
yum install -y bzip2-devel.x86_64
yum install -y gmp-devel.x86_64
yum install -y mysql-devel
yum install -ycurl-devel
yum install -y mcrypt
yum install -y zip
yum install -y gd-devel.x86_64
yum install -y t1lib-devel.x86_64
yum install -y libmcrypt-devel.x86_64
yum install -y libmhash-devel.x86_64
yum install -y libxslt-devel.x86_64
yum install -y libtool-ltdl-devel
- You will have a problem with mhash for sure… Now you need to download, compile and install it seperately
wget "http://downloads.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmhash%2Ffiles%2F&ts=1303806016&use_mirror=sunet"
bunzip2 mhash-0.9.9.9.tar.bz2
tar -xvf mhash-0.9.9.9.tar
cd mhash-0.9.9.9
./configure
make
make install
cd lib
make install
- At this point, I had some difficulty in getting the mash library at the right place. Anyway, Looking at the install script of mhash, I realized that it’s going to /usr/lib/local when it needs to go to /usr/lib64 . Simple fix
cd /usr/local/lib
cp -R * /usr/lib64/
./configure '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--with-t1lib=/usr' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--with-mime-magic=/usr/share/file/magic' '--with-apxs2=/usr/sbin/apxs' '--enable-soap' '--with-gd' '--enable-dom' '--disable-dba' '--without-unixODBC' '--enable-pdo' '--enable-xmlreader' '--enable-xmlwriter' '--without-sqlite' '--enable-json' '--without-pspell' '--enable-wddx' '--with-curl' '--enable-mbstring=all' '--disable-posix' '--disable-sysvmsg' '--disable-sysvshm' '--disable-sysvsem' '--with-mcrypt' '--with-mhash' '--with-mysql' '--enable-mysqli' '--with-mysqli=/usr/bin/mysql_config' '--with-pdo-mysql=/usr/bin/mysql_config' '--with-xsl' '--with-zip'
make clean
make
make install
service httpd restart
From http://cleverappz.com/site/2011/05/compiling-php-5-2-x-on-redhat-linux/
No comments:
Post a Comment