Install PHP 7 on CentOS 6
Install EPEP repo with command
1 |
yum install -y epel-release |
Next you need REMI repo, you can get it form
https://rpms.remirepo.net/
Install it with
1 |
rpm -ivh https://rpms.remirepo.net/enterprise/remi-release-6.rpm |
You can search for PHP versions with command
1 |
yum search php |
Select PHP version
First install yum-utils
1 |
yum install yum-utils |
Now you can select required PHP version with command
1 |
yum-config-manager --enable remi-php72 |
Use remi-php70 for PHP 7.0, remi-php71 for PHP 7.1
Install PHP
To install PHP 7.2, run
1 |
yum install php72 -y |
PHP binary will be installed as php72, you can create a synlink if you need.
1 |
ln -s /usr/bin/php72 /usr/bin/php |
Enable PHP in Apache
1 |
yum install php72-php |
Now restart apache
1 |
service httpd restart |