各个包下载地址:http://pan.baidu.com/s/1nt9NO7J
下载完成后安装,安装步骤如下:
1.安装libiconv
tar zxvf libiconv-1.13.1.tar.gzcd libiconv-1.13.1
./configure -prefix=/usr/local/libiconv
make
make install
2.libmcrypt安装
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure -prefix=/usr/local
make
make install
4.GD 安裝(对图片的支持,如验证码等)
而安裝 GD 前需要安裝 jpeg-6b, libpng, zlib, freetype。
(1)安裝 zlib
#不要用-prefix指定安装目录会影响GD
代码:
tar zxvf zlib-1.2.3.tar
cd zlib-1.2.3
./configure #或者 CFLAGS="-O3 -fPIC" ./configure #如果64位处理器需要 CFLAGS="-O3 -fPIC"
make
make install
(2)安裝 freetype
代码:
tar zxvf freetype-2.1.10.tar.gz
cd freetype-2.1.10
./configure -prefix=/usr/local/freetype
make
make install
(3)安裝 libpng
#不要用-prefix指定安装目录会影响GD
代码:
tar zxvf libpng-1.6.15.tar.gz
cd libpng-1.6.15
./configure
make
make install
(4)安裝 jpeg-7
代码:
tar zxvf jpegsrc.7.tar.gz
cd jpeg-7
./configure -prefix=/usr/local/jpeg --enable-shared --enable-static
make
make install
(5)安裝 GD
代码:
tar zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure -prefix=/usr/local/gd -with-jpeg=/usr/local/jpeg -with-png -with-zlib -with-freetype=/usr/local/freetype
make
make install
4.
到 php源码目录
./configure --prefix=/usr/local/php --with-apxs2=/usr/sbin/apxs --with-mysql --with-openssl --with-iconv=/usr/local/libiconv --with-bz2 --with-mcrypt=/usr/local --enable-soap --enable-sockets --enable-mbstring=all --enable-bcmath --enable-ftp -with-gd=/usr/local/gd -with-jpeg-dir=/usr/local/jpeg -with-zlib -with-png -with-freetype-dir=/usr/local/freetype
其中 --with-apxs2=/usr/sbin/apxs 跟apache的apxs目录,我的在/usr/sbin/apxs
make
make install
5.
检查apache配置文件httpd.config会有
LoadModule php5_module /usr/lib64/httpd/modules/libphp5.so
在 DirectoryIndex index.html index.html.var 后增加 index.php
添加 AddType application/x-httpd-php .php
保存配置文件