Cent OS 6.3 编译安装 php 5.6

发布时间:2020-05-18 05:24:54 作者:zhihua27
来源:网络 阅读:803



安装包(网盘地址)

 C语言xml parser类库 libxml2   http://pan.baidu.com/s/1eQhIQf4 

    openssl 类库下载地址 http://pan.baidu.com/s/1ntqYa4h

    bzip2下载地址   http://pan.baidu.com/s/1gdjcKQv

    zlib下载地址   http://pan.baidu.com/s/1dDgyYTr

    libcurl下载地址  http://pan.baidu.com/s/1c06j336

    jpeg类库下载地址  http://pan.baidu.com/s/1mg3RqWw

    libpng类库下载地址 http://pan.baidu.com/s/1eQuAdhC

    libfreetype类库下载地址 http://pan.baidu.com/s/1mgpEgOg

    libxslt 类库下载地址 http://pan.baidu.com/s/1dDEoYit

     PHP 5.6 ×××地址 http://pan.baidu.com/s/1mgEGDk8


所有安装包下载好后,放到 /url/local下解压,再安装

安装libxml2

     ./configure  --with-python=no

     make && make install

    

安装openssl

     ./configure

     make && make install

    

安装bzip2  

     make && make install


安装zlib

      ./configure

     make && make install


安装curl

      ./configure

     make && make install


安装 lib jpeg

      ./configure

     make && make install


安装 lib png

      ./configure

     make && make install


安装 lib freetype

      ./configure

     make && make install


安装 lib mcrypt

      ./configure

     make && make install


安装 libxslt

      ./configure

     make && make install

安装 httpd-devel  (  /usr/sbin/apxs )

      先 which apxs 查找 apxs ,如果找不到apxs则安装httpd-devel

      yum install httpd-devel


安装php

./configure --prefix=/usr/local/php \

--with-config-file-path=/usr/local/php/etc \
--with-config-file-scan-dir=/usr/local/php/etc/conf.d \
--enable-fpm \
--with-pear \
--with-curl \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-iconv \
--with-mcrypt \
--with-mhash \
--with-zlib \
--with-xmlrpc \
--with-xsl \
--with-openssl \
--with-mysql \
--with-mysqli \
--with-pdo-mysql \

--with-apxs2=/usr/sbin/apxs \
--disable-debug \
--enable-zip \
--enable-sockets \
--enable-soap \
--enable-mbstring \
--enable-inline-optimization \
--enable-xml \
--enable-ftp \
--enable-exif \
--enable-wddx \
--enable-bcmath \
--enable-calendar \
--enable-shmop \
--enable-dba \
--enable-sysvsem \
--enable-sysvshm \

--enable-sysvmsg 


make && make install

添加软链

   ln -s /usr/local/php/bin/php /usr/local/bin。

测试软链

       [root@localhost php]# ln -s /usr/local/php/bin/php /usr/local/bin/

[root@localhost php]# php -v

PHP 5.6.10 (cli) (built: Jun 18 2015 19:52:16)

Copyright (c) 1997-2015 The PHP Group

Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

[root@localhost php]#。

         测试成功

 libphp5.so 运行所依赖类库的上下文设置

      chcon -t texrel_shlib_t   /usr/local/lib/libfreetype.so.6

        chcon -t texrel_shlib_t   /usr/local/lib/libpng16.so.16

         chcon -t texrel_shlib_t  /usr/lib/httpd/modules/libphp5.so (这句可以不执行)

         echo /usr/local/lib >> /etc/ld.so.conf & ldconfig


备注:service httpd start 运行可能会出现/usr/local/lib/libfreetype.so.6: cannot restore segment prot after reloc: Permission denied等错误,上面的命令是保证apache 启动时 libphp5.so模块运行的依赖类库能正常加载,保证apache加载libphp5.so后能正常启动所做的设置

配置文件修改

  配置文件php.ini修改。在安装时,我们配置了配置文件的安装目录为 /usr/local/php/etc 从源码目录拷贝配置文件到这个目录

          cp /usr/local/php-5.6.10/php.ini-development /usr/local/php/etc/php.ini


推荐阅读:
  1. PHP、MYSQLI实现分页(初学者)
  2. PHP code coverage QuickStart

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

php centos 下载地址

上一篇:jQuery each()的用法。

下一篇:Linux进程死锁定位

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》