php5.4.13.tar.bz2,php5.4.13源码安装编译

Centos6.2安装PHP

1;安装Php程序环境

1,1 php是依赖apache和mysql的,所以先要检查apache及mysql的安装情况

首先检查apache和mysql是否安装 查看服务器是否起来 是否运行正常

这里有个重点,以后不管在哪台服务器上安装php都需要在这台服务器上先安装mysql,这样才能连接远程的数mysql数据库

1,2 查看以前是否安装过php

[root@taoke1 mysql]# rpm -qa |grep php

如果安装过需要先卸载php

[root@taoke1 mysql]# rpm -e  --nodeps php

2;安装php所依赖的库文件包

2,1安装freetype

[root@taoke1 ~]# tar jxvf freetype-2.3.10.tar.bz2

[root@taoke1 ~]# cd freetype-2.3.10

[root@taoke1 freetype-2.3.10]#  ./configure --prefix=/usr/local/freetype

[root@taoke1 freetype-2.3.10]# make && make install

2,2安装jpeg

[root@taoke1 ~]# tar -xzvf jpegsrc.v7.tar.gz

[root@taoke1 ~]# cd jpeg-7/

[root@taoke1 jpeg-7]# ./configure --prefix=/usr/local/jpeg

[root@taoke1 jpeg-7]# make && make install

2,3安装libpng

[root@taoke1 ~]# tar jvxf libpng-1.2.41.tar.bz2

[root@taoke1 ~]# cd libpng-1.2.41

[root@taoke1 libpng-1.2.41]# make && make install

2,3安装libiconv

[root@taoke1 ~]# tar -zxvf libiconv-1.14.tar.gz

[root@taoke1 ~]# cd libiconv-1.14

[root@taoke1 libiconv-1.14]# ./configure --prefix=/usr/local/libiconv

[root@taoke1 libiconv-1.14]# make && make install

2,4安装GD

2,4,1检测/usr/include下是否有链接头文件pngconf.h  png.h

[root@taoke1 include]# ln -s /usr/local/libpng/include/pngconf.h /usr/include

[root@taoke1 include]# ln -s /usr/local/libpng/include/png.h /usr/include

2,4,2安装GD

[root@taoke1 ~]# tar -xzvf gd-2.0.33.tar.gz

[root@taoke1 ~]# cd gd-2.0.33

[root@taoke1 gd-2.0.33]# ./configure --prefix=/usr/local/gd2 --with-freetype=/usr/local/freetype --with-png=/usr/local/libpng --with-jpeg=/usr/local/jpeg

[root@taoke1 gd-2.0.33]# make && make install

2,5安装libmcrypt

[root@taoke1 ~]# tar -xzvf libmcrypt-2.5.7.tar.gz

[root@taoke1 ~]# cd libmcrypt-2.5.7

[root@taoke1 libmcrypt-2.5.7]# ./configure

[root@taoke1 libmcrypt-2.5.7]# make && make install

3;安装php包备注:我编译php5.5.X或者5.6.0的php老是提示gd库版本低,无奈换了个低版本的源码包

[root@taoke1 ~]# tar -xzvf php-5.4.13.tar.gz

[root@taoke1 ~]# cd php-5.4.13

./configure \

--prefix=/usr/local/php \

--with-gd=/usr/local/gd2 \

--with-apxs2=/usr/local/apache/bin/apxs \

--enable-mbregex \

--enable-bcmath \

--with-mysql=/usr/local/mysql \

--with-zlib-dir \

--enable-mbstring=all \

--with-pdo-mysql \

--with-freetype-dir=/usr/local/freetype \

--with-jpeg-dir=/usr/local/jpeg \

--with-openssl \

--with-curl \

--disable-fileinfo 【内存小于1G用这个参数】

安装

[root@taoke1 php-5.4.13]# make ZEND_EXTRA_LIBS='-liconv'

[root@taoke1 php-5.4.13]# make install

4;修改php配置文件

[root@taoke1 php-5.4.13]# cp php.ini-production /etc/php.ini

4,1vi /etc/php.ini #编辑

date.timezone = PRC #在946行 把前面的分号去掉,改为date.timezone = PRC

disable_functions =

4,2;编辑httpd.conf 添加index.php

DirectoryIndex index.htmlindex.php

4,3在AddType中添加两行

AddType application/x-httpd-php .php .php3 .phtml .inc

AddType application/x-httpd-php-source .phps

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值