Update the PHP version on CentOS 7 Print

  • 0

Install PHP, enter the following command:

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

Check the current PHP version:
# php -v

Enabling the Remi repository:
# yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

Installing yum-utils:
# yum install yum-utils

yum-utils includes a yum-config-manager that can be used to enable Remi as the default repository for installing various versions of PHP.

If you want to install PHP updates on CentOS 7, just enable it as shown below:

# yum-config-manager --enable remi-php71
# yum-config-manager --enable remi-php72 
# yum-config-manager --enable remi-php73
# yum-config-manager --enable remi-php74

Choose for example PHP 7.4
# yum-config-manager --enable remi-php74

Updating:
# yum update

Check the PHP version again:

# php -v


Was this answer helpful?

« Back