Installing PHP 7.2 on Centos 7 / Redhat RHEL

Out of the box Centos / RHEL 7 installs PHP 5.x by default.  To grab a copy of PHP first enable the EPEL Repository.  Upgrading a previously installed 5.x version of PHP or performing a fresh install of PHP 7.2 can easily be performed with the following:

1
2
3
4
5
6
7
8
yum install -y epel-release
yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install -y yum-utils
yum-config-manager --enable remi-php72
yum update -y
yum install -y php72
yum install -y php72-php-fpm php72-php-gd php72-php-json php72-php-mbstring php72-php-mysqlnd php72-php-xml php72-php-xmlrpc php72-php-opcache
php -v

To configure PHP fpm for nGinx:

1
2
sudo systemctl enable php72-php-fpm.service
sudo systemctl start php72-php-fpm.service
Lima

About the author

Lima is the visual nautical indicator for "stop instantly."

Leave a Reply