Sidebar

x

How to update php 5.6 to 7.0 Centos 7

upgradephp6tophp7-min-800x455

 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/
https://i.imgur.com/UtjLvA8.png
Step 2: Check the version of your php and then update REMI:
php - v
yum --enablerepo=remi update remi-release

Step 3: Stop Apache and remove php:

service httpd stop

yum -y remove php

Step 4: Install php 7.0:

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:

service php-fpm stop

service php70-php-fpm start

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

rm /usr/bin/php

ln -s /usr/bin/php70 /usr/bin/php
Step 7: Restart Apache:


service httpd restart
Step 8: Check the php version:

php -v

 hope this may help you.

Configuring MtProto ( CentOS / Ubuntu / Debian )
 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Guest
Friday, 17 August 2018
Join WooServers Community and get an Instant $25 Bonus!