PHP 7 is available, let’s upgrade with this PHP7 upgrade step-by-step tutorial.

Install and enable remi repository (in case it’s not installed yet)

1
2
3
4
5
wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
sudo rpm -Uvh remi-release-7*.rpm
yum --enablerepo=remi update remi-release
yum --enablerepo=remi-php70

Stop httpd and remove old php version

1
2
service httpd stop
yum remove php php-common # remove old php version

Install php70

1
2
3
yum install php70-php
yum install php70-php-pear php70-php-bcmath php70-php-pecl-jsond-devel php70-php-mysqlnd php70-php-gd php70-php-common php70-php-fpm php70-php-intl php70-php-cli php70-php php70-php-xml php70-php-opcache php70-php-pecl-apcu php70-php-pecl-jsond php70-php-pdo php70-php-gmp php70-php-process php70-php-pecl-imagick php70-php-devel php70-php-mbstring
ln -s /usr/bin/php70 /usr/bin/php # make symbolic link, so programs depending on previous versions of php will still work

Start apache

1
service httpd start

If you use php-fpm, restart it

1
2
3
service php-fpm stop
service php70-php-fpm start
systemctl enable php70-php-fpm # make php70-fpm start on reboot

Note that php-fpm config and php.ini files will be in /etc/opt/remi/php70/ and not in /etc as usual.

That’s it. Enjoy your new fast PHP:)