#!/bin/bash
# yum -y install curl curl-devel libxml2 libxml2-devel libjpeg libjpeg-devel libpng libpng-devel zlib zlib-devel freetype freetype-devel openldap openldap-devel xmlrpc
if [ `getconf LONG_BIT` == 64 ];then
yum -y install curl.i386 curl-devel.i386 libxml2.i386 libxml2-devel.i386 libjpeg.i386 libjpeg-devel.i386 libpng.i386 libpng-devel.i386 zlib.i386 zlib-devel.i386 freetype.i386 freetype-devel.i386 openldap.i386 openldap-devel.i386 xmlrpc.i386
yum -y install curl.x86_64 curl-devel.x86_64 libxml2.x86_64 libxml2-devel.x86_64 libjpeg.x86_64 libjpeg-devel.x86_64 libpng.x86_64 libpng-devel.x86_64 zlib.x86_64 zlib-devel.x86_64 freetype.x86_64 freetype-devel.x86_64 openldap.x86_64 openldap-devel.x86_64 xmlrpc.x86_64
else
yum -y install curl.x86_64 curl-devel.x86_64 libxml2.x86_64 libxml2-devel.x86_64 libjpeg.x86_64 libjpeg-devel.x86_64 libpng.x86_64 libpng-devel.x86_64 zlib.x86_64 zlib-devel.x86_64 freetype.x86_64 freetype-devel.x86_64 openldap.x86_64 openldap-devel.x86_64 xmlrpc.x86_64
fi
tar zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure--prefix=/usr
make && make install
cd ..
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure--prefix=/usr
make && make install
cd libltdl/
./configure--prefix=/usr --enable-ltdl-install
make && make install
cd ../..
tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure--prefix=/usr
make && make install
cd ..
tar zxvf freetds-0.64.tar.gz
cd freetds-0.64
./configure--prefix=/usr/local/freetds --enable-msdblib --with-gnu-ld --with-tdsver=8.0
make && make install
cd ..
echo"/usr/local/freetds/lib">> /etc/ld.so.conf.d/freetds.conf
ldconfig -v
tar zxvf php-5.2.6.tar.gz
cd php-5.2.6
if [ `getconf LONG_BIT` == 64 ];then
./configure--prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/php/etc --enable-bcmath --with-curl --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --with-ldap --enable-mbstring --with-mcrypt --with-mhash --with-mssql=/usr/local/freetds --with-mysql=/usr/local/mysql --enable-pcntl --with-pdo-mysql=/usr/local/mysql --with-pdo-oci=/usr/lib/oracle/10.2.0.4/client64 --enable-soap --enable-sockets --with-xmlrpc
else
./configure--prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/php/etc --enable-bcmath --with-curl --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --with-ldap --enable-mbstring --with-mcrypt --with-mhash --with-mssql=/usr/local/freetds --with-mysql=/usr/local/mysql --enable-pcntl --with-pdo-mysql=/usr/local/mysql --with-pdo-oci=/usr/lib/oracle/10.2.0.4/client --enable-soap --enable-sockets --with-xmlrpc
fi
make && make install
cd ..