Post4VPS Forum | Free VPS Provider
How to upgrade php from 5.6 to 7.0 in VestaCP with CentOS 7.0 - Printable Version

+- Post4VPS Forum | Free VPS Provider (https://post4vps.com)
+-- Forum: VPS Discussion (https://post4vps.com/Forum-VPS-Discussion)
+--- Forum: Tutorials (https://post4vps.com/Forum-Tutorials)
+--- Thread: How to upgrade php from 5.6 to 7.0 in VestaCP with CentOS 7.0 (/Thread-How-to-upgrade-php-from-5-6-to-7-0-in-VestaCP-with-CentOS-7-0)



How to upgrade php from 5.6 to 7.0 in VestaCP with CentOS 7.0 - deanhills - 08-02-2018

I'm currently playing with an installation of myBB and found that a number of the plugins have been designed for php 7.0.  In addition I've also noticed cPanel is going to deprecate php 5.0 at end of this year, so thought to figure out a way to upgrade my VPS php from 5.6 to 7.0.  I'm using VestaCP to manage my VPS since it is a free panel and also light in resources.  VestaCP comes automatically loaded with php 5.6.  Php 5.6 has worked very well for me until my experimentation with myBB so thought to use my cheap VPS to experiment with the upgrade and to see how my WordPress sites respond.  So far none of the WordPress backups that have been created with php 5.6 have failed with php 7.0 after their imports.  Even though my backup plugin warned me it could happen.  Mission successfully accomplished so far!

This is how I upgraded my php from 5.6 to 7.0.  Note my VPS OS is CentOS 7.0 64 bit. 

Step 1:  Install VestaCP and REMI

When you install VestaCP make sure to use the Installation Script Generator at the URL below (Advanced Install Settings) and to select the REMI repo option. 
https://vestacp.com/install/
[Image: UtjLvA8.png]
Step 2:  Check the version of your php and then update REMI:
Code:
php - v

Code:
yum --enablerepo=remi update remi-release

Step 3: Stop Apache and remove php:

Code:
service httpd stop

Code:
yum -y remove php

Step 4: Install php 7.0:

Code:
yum --enablerepo=remi-php70 install php70-php 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

Step 5: Stop old php and start php 7.0:

Code:
service php-fpm stop


Code:
service php70-php-fpm start

Step 6: Remove the old symblink php and create a new one:

Code:
rm /usr/bin/php

Code:
ln -s /usr/bin/php70 /usr/bin/php

Step 7: Restart Apache:

Code:
service httpd restart

Step 8: Check the php version:

Code:
php -v