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:
[bash]yum install -y yum-utils[/bash]
- Enable php70:
[bash]yum-config-manager –enable remi-php70[/bash]
- 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:
[bash]yum remove php-opcache php-mysql[/bash]
- Upgrade to PHP7:
[bash]yum update php\*[/bash]
- Install php-mysqli to replace php-mysql extension, and install new opcache one:
[bash]yum install php-mysqli
yum install php-opcache[/bash]Another way to upgrade php-myql seamlessly:
[bash]yum shell
remove php-mysql
install php-mysqlnd
run
quit[/bash] - All done! Enjoy new PHP version