一、系统环境
centos/redhat 7
二、下载PHP源码,并解压
wget http://cn2.php.net/distributions/php-5.6.0.tar.xz xz -d php-5.6.0.tar.xz tar xf php-5.6.0.tar -C /usr/local/src/
三、安装PHP依赖包
yum install gcc bison bison-devel zlib-devel libmcrypt-devel mcrypt mhash-devel openssl-devel libxml2-devel libcurl-devel bzip2-devel readline-devel libedit-devel sqlite-devel
3.1 在Centos 7源中不能安装libmcrypt-devel,由于版权的原因没有自带mcrypt的包
解决方法一:
1、安装第三方yum源
wget http://www.atomicorp.com/installers/atomic sh ./atomic
2、使用yum命令安装
yum install php-mcrypt libmcrypt libmcrypt-devel
解决方法二:
libmcrypt源码安装方法:
cd /usr/local/src wget http://softlayer.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.8.tar.gz tar -zxvf libmcrypt-2.5.8.tar.gz cd /usr/local/src/libmcrypt-2.5.8 ./configure --prefix=/usr/local make make install