Upgrading PHP on CentOS 6.5 (Final)

前端 未结 7 1314
死守一世寂寞
死守一世寂寞 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:17

    Steps for upgrading to PHP7 on CentOS 6 system. Taken from install-php-7-in-centos-6

    To install latest PHP 7, you need to add EPEL and Remi repository to your CentOS 6 system

    yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
    yum install http://rpms.remirepo.net/enterprise/remi-release-6.rpm
    

    Now install yum-utils, a group of useful tools that enhance yum’s default package management features

    yum install yum-utils
    

    In this step, you need to enable Remi repository using yum-config-manager utility, as the default repository for installing PHP.

    yum-config-manager --enable remi-php70
    

    If you want to install PHP 7.1 or PHP 7.2 on CentOS 6, just enable it as shown.

    yum-config-manager --enable remi-php71 
    yum-config-manager --enable remi-php72
    

    Then finally install PHP 7 on CentOS 6 with all necessary PHP modules using the following command.

    yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo
    

    Double check the installed version of PHP on your system as follows.

    php -V 
    

提交回复
热议问题