Article overview

Help article

cPanel Tutorial Series 3: Updating your VPS

This is the third part of our cPanel Tutorial Series. If you are setting up a new VPS with cPanel, we recommend starting with part 1.

Our pre-installed version of cPanel comes with CentOS 7 as the underlying operating system. By default, CentOS 7 makes use of older versions of software (though with recent security updates) because it prefers stability over new features.

For that reason, not all software on your VPS is up-to-date. For example, at the time of writing the latest version of our cPanel VPS (68.0.23) is supplied with PHP 5.6.35 and MySQL 5.6.38. In this section, we show you how to update and adjust the default versions on your entire VPS. In part 5 we show you how to do this at the domain level.

Especially CMS systems like WordPress often require newer versions of PHP and MySQL to function. It is therefore advisable to update your VPS. 

Updates from software used by cPanel & WHM (e.g. PHP and MySQL, but not Fail2Ban for example) are best done from cPanel for optimal compatibility. If you install versions from command line, you increase the chance that a problem arises because your installed version may not work when combined with cPanel & WHM.

In this part we cover the following topics:

  • Updating cPanel & WHM
  • Updating CentOS 7
  • Adding additional PHP versions in WHM
  • Adjusting the default PHP version and enabling PHP-FPM in WHM
  • Adjusting the PHP version per domain
  • Adjusting PHP.ini in WHM
  • Updating and modifying the SQL database version in WHM

Updating cPanel & WHM

cPanel automatically checks for software updates on a daily basis and applies them to your VPS. You can easily upgrade the version of cPanel & WHM itself from WHM in two steps.

 

Step 1

Log in to WHM and click on the version number of cPanel & WHM at the top right.

whm version number


 

Step 2

Then click 'Click to Upgrade' to update cPanel & WHM.

whm upgrade to latest version

Reboot your VPS to process the changes afterwards.

Updating CentOS 7

There are two options to update cPanel, WHM and CentOS 7 at the same time: using EasyApache 4, or from the command line of your VPS with the command below. You have already completed these steps if you are following this tutorial series while installing Fail2Ban and / or ClamAV.                  


 

Update from command line  

We prefer command line, especially if you are already connected via SSH because you only need one command. Connect to your VPS via SSH or the VPS console in your control panel and use the command:

sudo yum update


Updating from WHM  

 

Step 1

Log in to WHM (port 2087) and search for 'easy' in the search field at the top left. Click 'EasyApache 4' in the search results under 'Software'. You will see an overview as shown in the example below.

whm easy apache


 

Step 2

Click 'Run system update'> 'Update'

whm system update


 

Step 3                       

WHM then asks for permission to perform the updates. Click 'Yes, run system update'.

whm confirm system update


Not every change to your VPS is immediately implemented but will only be processed after a restart. We therefore recommend that you restart your VPS after a software update. 

Adding additional PHP versions in WHM

cPanel uses EasyApache 4 for the management of Apache and PHP and is supplied with Apache 2.4, PHP 5.5, PHP 5.6 and PHP 7.0 at the time of writing. For example, if you want to use PHP 5.4 or 7.2 in cPanel, you have to make it available in WHM first.

 

Step 1

Log in to WHM (port 2087) and search for 'easy' in the search field at the top left. Click 'EasyApache 4' in the search results under 'Software'. You will see an overview as shown in the example below.

whm easy apache


 

Step 2                       

Click on 'Customize' next to 'Currently Installed Packages'.

whm easy apache currently installed package


 

Step 3                       

The EasyApache 4 menu appears and 'Apache MPM' is opened by default.

Click 'PHP Versions' in the EasyApache 4 menu. You will see an overview of the PHP versions that are available in your cPanel & WHM installation. Turn PHP versions on or off as desired and click 'Review' in the EasyApache 4 menu.

whm easy apache php versions

If desired, before going to ‘Review’, you can also make adjustments for Apache MPM, Apache Modules, PHP Extensions, or Rubyvia Passnger. However, these options fall outside the scope of this manual.


 

Step 4                       

EasyApache then shows you an overview of the changes that will be made. Check the overview and click 'Provision' at the bottom.

whm easy apache review

Adjusting the default PHP version and enabling PHP-FPM in WHM

In cPanel and WHM, PHP 5.6 is used by default and PHP-FPM is switched off. The performance (and security) of newer PHP versions is better than that of older versions. The same is true for the use of PHP-FPM compared to for example mod_php.  

In the steps below we change the default PHP version and enable PHP-FPM in WHM for all accounts. If you add a domain in cPanel, it will automatically use the PHP version and PHP-FPM after these steps. You can always manually adjust the PHP version later per domain.

 

Step 1            
Log in to WHM (port 2087) and look for 'MultiPHP' in the search field at the top left. Click 'MultiPHP Manager'.

If you have installed a new PHP version like PHP 7.2 in the previous section, you may be shown a notification about PHP-FPM as in the screenshot below. In that case, click 'Install', if not, continue to Step 3.        

whm php fpm upgrade warning


 

Step 2            

You will see an overview as shown in Step 4 in the previous section 'Adding extra PHP versions in WHM'. Scroll down again and click 'Provision'.

WHM opened a separate tab for these installation steps. Close it and return to the MultiPHP Manager.


 

Step 3

Click 'Edit' directly after ea-php56 in MultiPHP Manager.

whm multiphp manager


 

Step 4

Select the desired PHP version from the drop-down menu and click 'Apply'.  

whm change system php version


 

Step 5 

Then click 'Turn On' after 'System PHP-FPM Status' to enable PHP-FPM.

whm enable php fpm


 

Please note: Did you go through the above steps on an existing VPS instead of a new installation? Then click 'Convert All Accounts to PHP-FPM' to enable PHP-FPM for all existing accounts. 

Adjusting the PHP version per domain

In the previous section, we have adjusted the PHP version which your domains use by default. You probably noticed (at the bottom of the screenshot) in step 3 in the previous section that you can change the PHP version in WHM per domain. This principle works basically the same in cPanel and also uses the MultiPHP Manager:

 

Step 1

Log in to cPanel, scroll down to 'Software' on the main page and click 'MultiPHP Manager'.

cpanel software


 

Step 2

Check the domain (or domains) for which you want to change the PHP version, after 'PHP Version' select the PHP version you want to use and click 'Apply'.

cpanel set php version per domain


cPanel shows you a confirmation and the PHP version has been directly adjusted under 'PHP version'.

cpanel php version example

Adjusting PHP.ini in WHM

You can adjust php.ini settings such as the memory_limit and max_execution_time in WHM and cPanel. Both work identically with the only difference being that in WHM the adjustment adjusts the default values ​​for all domains still to be added, and in cPanel you only adjust it for the domain in question specifically.

 

WHM

Step 1

Log in to WHM (for adjusting the php.ini server default), search in the search field at the top left for 'multiphp' and click 'MultiPHP INI Editor'. Then proceed to Step 2 under cPanel.

whm multiphp ini editor


 

cPanel

Step 1

Log in to cPanel (for adjusting php.ini for a specific domain), scroll down to 'Software' and click 'MultiPHP INI Editor'.

cpanel software


 

Step 2

You will see an overview as below. Adjust the values ​​as desired and then scroll down and click 'Apply' to process the changes.

whm multiphp ini editor overview

Updating and modifying the SQL database version in WHM

By default, cPanel uses MySQL 5.6.38 as MySQL server. In this manual, we will change this to MariaDB 10.2. MariaDB 10.2 largely corresponds to MySQL 5.7 (see this page for similarities and differences).

 

Step 1

Log in to WHM and type 'MySQL' in the search field at the top left and click 'MySQL/MariaDB Upgrade' in the search results under 'Software'.


 

Step 2

You will see the overview below. Select the SQL version you want to use (we recommend MariaDB 10.1 or 10.2) and click 'Next' at the bottom left. 

whm mysql mariadb upgrade


 

Step 3 

MariaDB 10.1 and 10.2 are a nice step forward compared to MySQL 5.6. You will therefore see some warnings. Tick ​​all options and click 'Continue'. 

whm mysql mariadb upgrade


 

Step 4

Then choose whether you want to perform an automatic or step-by-step installation. For this manual, we opted for the automatic (unattended) installation. This option also updates Ruby Gems (a package manager for the Ruby programming language). 

whm mysql mariadb upgrade step 3


The installation will take some time (+ - 15 minutes at the time of writing this manual).


 

Your VPS is not only safe but also completely up-to-date and ready to connect domains. Click here to continue to Part 4: Linking domains and subdomains.

Should you have any questions left regarding this article, do not hesitate to contact our support department. You can reach them via the ‘ContactUs’ button at the bottom of this page.

If you want to discuss this article with other users, please leave a message under 'Comments'.

 

Do you have a good idea?

Give us your idea! If it's popular we'll add it to the wishlist!

Has this article been helpful?

Create an account or log in to leave a rating.

Comments

Create an account or log in to be able to leave a comment.

Are you stuck?

Ask one of our specialists to assist you

Contact us