Upgrading PHP on CentOS 6.5 (Final)

前端 未结 7 1237
死守一世寂寞
死守一世寂寞 2020-11-30 18:04

I\'m trying to update my PHP (currently v:5.3.3 to the latest stable PHP build) but it\'s not playing ball and it\'s saying there is nothing to update.

Any help woul

相关标签:
7条回答
  • 2020-11-30 18:26

    As Jacob mentioned, the CentOS packages repo appears to only have PHP 5.3 available at the moment. But these commands seemed to work for me...

    rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
    yum remove php-common       # Need to remove this, otherwise it conflicts
    yum install php56w
    yum install php56w-mysql
    yum install php56w-common
    yum install php56w-pdo
    yum install php56w-opcache
    php --version               # Verify version has been upgraded
    

    You can alternatively use php54w or php55w if required.

    CAUTION!
    This may potentially break your website if it doesn't fully resolve all your dependencies, so you may need a couple of extra packages in some cases. See here for a list of other PHP 5.6 modules that are available.

    If you encounter a problem and need to reset back to the default, you can use these commands:

    sudo yum remove php56w
    sudo yum remove php56w-common
    sudo yum install php-common
    sudo yum install php-mysql
    sudo yum install php
    

    (Thanks Fabrizio Bartolomucci)

    0 讨论(0)
提交回复
热议问题