Upgrade to PHP 7 on CentOS
Well, PHP7 has just been released as you can read on the php.net website. Time to celebrate 🙂 So in this quick tutorial, I will note necessary steps to ugprade to PHP 7 on CentOS, assuming that you are using PHP with FPM with remi repo. Necessary steps are as follows:
- First, install yum-utils:
yum install -y yum-utils - Enable php70:
yum-config-manager --enable remi-php70 - If you are using php-mysql and php-opcache with PHP5-4. these extensions will not be compatible with PHP7. So you will need to remove them:
yum remove php-opcache php-mysql - Upgrade to PHP7:
yum update php\* - Install php-mysqli to replace php-mysql extension, and install new opcache one:
yum install php-mysqli yum install php-opcacheAnother way to upgrade php-myql seamlessly:
yum shell remove php-mysql install php-mysqlnd run quit - All done! Enjoy new PHP version