CentOS下安装PHP5.2.17和ZendOptimizer 3.3.9

由于部署的原因,需要安装低版本的PHP和Zend,不能使用yum安装,参考网上两篇文件:

http://www.92csz.com/19/603.html

http://it.chinawin.net/softwaredev/article-24a56.html

因为安装环境有所不同,因此对这两篇文件进行了整合和局部改动,以能满足安装需求。

我的安装环境是:Centos 6.5 64位版,装来的部署环境为阿里云的Centos 6.5 64位版,因为Google被封,有些软件已经下载不到,我会放在我的阿里云上,供大家下载

第一步:安装系统环境需要的软件

yum install -y gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-libs krb5-devel krb5-server libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers

第二步:编译安装PHP所需要的库

mkdir -p /data/soft
mkdir -p /data/src
cd /data/src
wget http://www.etiansoft.com/downloads/php/libiconv-1.13.1.tar.gz
tar zxvf libiconv-1.13.1.tar.gz
cd libiconv-1.13.1
./configure --prefix=/usr/local
make && make install
cd ..
wget http://www.etiansoft.com/downloads/php/libmcrypt-2.5.8.tar.gz
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure
make && make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make && make install
cd ../../
wget http://www.etiansoft.com/downloads/php/mhash-0.9.9.9.tar.bz2
tar jxvf mhash-0.9.9.9.tar.bz2
cd mhash-0.9.9.9
./configure
make && make install
echo "/usr/local/lib" >>/etc/ld.so.conf
/sbin/ldconfig
cd ..
wget http://www.etiansoft.com/downloads/php/mcrypt-2.6.8.tar.gz
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8
/sbin/ldconfig
./configure
make && make install

 第三步:编译安装mysql

cd /data/src
wget http://www.etiansoft.com/downloads/php/mysql-5.1.72.tar.gz
tar zxvf mysql-5.1.72.tar.gz
cd mysql-5.1.72
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
./configure --prefix=/data/soft/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile
make && make install
chown -R mysql:mysql /data/soft/mysql
chmod u+w /data/soft/mysql
mkdir -p /data/soft/mysql/database
chown -R mysql:mysql /data/soft/mysql/database
 以mysql用户帐号的身份建立数据表:
/data/soft/mysql/bin/mysql_install_db --basedir=/data/soft/mysql --datadir=/data/soft/mysql/database --user=mysql
 创建mysql配置文件
rm -rf /data/soft/mysql/my.cnf
vi /data/soft/mysql/my.cnf

相关推荐