安装前准备
1 2 3 4 5 6 7 8 9 10
| yum -y install gcc automake autoconf libtool make
yum -y install gcc gcc-c++ glibc
yum -y install libmcrypt-devel mhash-devel libxslt-devel \ 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 krb5-devel libidn libidn-devel openssl openssl-devel
|
安装
1 2 3 4 5 6 7 8 9 10 11 12
| tar zvxf php-5.4.7.tar.gz cd php-5.4.7 ./configure --prefix=/usr/local/php --enable-fpm --with-mcrypt \ --enable-mbstring --disable-pdo --with-curl --disable-debug --disable-rpath \ --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets \ --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex \ --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli \ --with-gd --with-jpeg-dir
make make install
|
no package libmcrypt available
centos官方默认不对mcrypt模块支持,需要安装epel扩展 .在http://mirrors.sohu.com/fedora-epel/6/i386/ 使用 Ctrl+F 搜索关键词“epel-release” 找到当前最新的扩展包发现最新版本为:epel-release-6-7.noarch.rpm
1 2 3
| wget http://mirrors.sohu.com/fedora-epel/6/i386/epel-release-6-7.noarch.rpm rpm -ivh epel-release-6-7.noarch.rpm
|
然后就可以安装
1 2
| yum install libmcrypt-devle
|
安装后如果运行yum报错
vim /etc/yum.repos.d/epel.repo
将
改成