PHP源码安装

1 篇文章 0 订阅

各个包下载地址:http://pan.baidu.com/s/1nt9NO7J

下载完成后安装,安装步骤如下:

1.安装libiconv

tar zxvf libiconv-1.13.1.tar.gz
cd 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
保存配置文件









评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值