Centos Update PHP To Version 7

less than 1 minute read

Description:

In my testlab, I needed to update my Centos 7 VM’s version of PHP to version 7, this is how I did it:

To Resolve:

  1. Run the following (Your mileage may vary):

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    
    sudo yum remove php-cli mod_php php-common
    
    sudo yum update -y
    
    systemctl stop httpd
    
    rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
    yum -y install yum-utils
    yum update -y
    yum-config-manager --enable remi-php71
    yum -y install php php-opcache
    yum -y install php-mysqlnd php-pdo
    
    # didn't do:
    # In the next step I will install some common PHP modules that are required by CMS Systems like Wordpress, Joomla, and Drupal:
    # yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-soap curl curl-devel
    
    systemctl start httpd
    systemctl status httpd
    

Tags:

Categories:

Updated:

-----------------------------------------------------------
Spotted a mistake in this article? Why not suggest an edit!
-----------------------------------------------------------

Comments