Updates

LightBlog

Wednesday, November 1, 2017

Update VestaCP to PHP 7.1 on CentOS 7

Image result for CentOS

This guide is very similar to our other guide on installing PHP 7 since we’re using the same method although this time, as the title suggests we’ll be using the latest stable version of PHP instead, 7.1

First let’s make sure your server is up to date.

Code:
sudo yum update
We’ll also check what version of PHP we have installed for reference.

Code:
php -v
Now we make sure that yum-utils is installed

Code:
sudo yum install yum-utils
If it’s already installed, great move on to the next step, if not then allow it to install.

Now we can enable remi-php71

Code:
sudo yum-config-manager --enable remi-php71
Now we can tell yum to update, this will upgrade our old version of PHP to 7.1

Code:
sudo yum update
After the process has finished your server will now have PHP 7.1 installed, we need to restart our web server for it to take effect however.

If you have Apache and NGINX installed, or just Apache installed run

Code:
sudo service httpd restart
If you are running NGINX and PHP-FPM then run

sudo service php-fpm restart && sudo service nginx restart
Lastly we’ll check the PHP version like we did at the start

Code:
php -v
And you should see something similar to :emoji_heart_eyes:


Code:
PHP 7.1.2 (cli) (built: Aug 2 2017 12:13:05) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
This isn’t required but if you would like to keep your system clean then we can now disable the older versions of PHP from our system. To do this run the following


Code:
sudo yum-config-manager --disable remi-php56
sudo yum-config-manager --disable remi-php55
sudo yum-config-manager --disable remi-php56-debuginfo
sudo yum-config-manager --disable remi-php55-debuginfo
sudo yum clean all
sudo yum update
And that’s it, now you have PHP 7.1 running on your VestaCP install on CentOS 7.1

If you have any problems leave a comment and I’ll try to help out :emoji_blush:

No comments:

Post a Comment