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,1 vi /etc/php.ini #编辑

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

 disable_functions =

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

  <IfModule dir_module>

  DirectoryIndex index.html index.php

 </IfModule>

   4,3在AddType中添加两行

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

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

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。

分享文章:php5.4.13源码安装编译-创新互联
分享链接:https://www.cdcxhl.com/article46/cojchg.html

成都网站建设公司_创新互联,为您提供网站维护网站收录小程序开发做网站品牌网站制作外贸网站建设

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

搜索引擎优化