php升级5.6

操作系统:CenterOS 6.7

当前php版本5.3 需要升级5.6

有两种办法

方法一.通过更改epel,达到升级目的

   1.下载更新epel

    wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
    rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

    2.编辑remi.repot

     vim /etc/yum.repos.d/remi.repo

     以下部分只需要修改一个即可


     升级5.4

     选择下面这种方式升级将enable从0改为1

    

     升级5.5

     选择下面这部分将其enable从0改为1

     升级5.6

     选择下面这部分将其enable从0改为1

    

    剩下的部分保持不变

     

   3.最后一步

   yum update -y  //更新当下的yum上所对应的php版本

     

    4.成功之后

    php -v 查看php版本


方法二.下载php5.6替换linux上已有的php

   1.卸载之前的php版本

       卸载之前的php

       yum remove php -y

   2.下载php5.6版本

       wget http://cn2.php.net/distributions/php-5.6.0.tar.xz

   3.解压

      xz -d php-5.6.0.tar.xz

      tar xf php-5.6.0.tar

   4.安装php并安装一些php运行时所需要的环境

      cd php-5.6.0 

      ./configure --prefix=/usr/local/php56 --with-config-file-path=/usr/local/php56/etc --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-           opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gettext --enable-             mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --with-libxml-dir --enable-pcntl --enable-shmop --enable-sysvmsg --               enable-sysvsem --enable-sysvshm --enable-sockets --with-curl --with-zlib --enable-zip --with-bz2 --with-readline

      make && make install 

  5.安装结束

    测试输出

     phpinfo();


  6.安装php的时候可能出现的错误

      错误:xml2-config not found. Please check your libxml2 installation
      解决办法: yum install libxml2 libxml2-devel -y
      错误:checking for BZip2 in default path... not found
      解决办法:yum install bzip2-devel bzip2  -y
      错误:configure: error: Please reinstall the libcurl distribution -easy.h should be in <curl-dir>/include/curl/
      解决办法: yum -y install curl-devel
      错误:configure: error: mcrypt.h not found. Please reinstall libmcrypt.
      解决办法:yum -y  install  php-mcrypt  libmcrypt  libmcrypt-devel
      错误:configure: error: Please reinstall readline - I cannot find readline.h
      解决办法:yum -y install readline-devel 

    

     

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值