update PHP version on cPanel

If you have a WordPress website, you might have encountered a situation where WordPress requests you to update your PHP version. This is because applications/plugins or even themes used in WordPress might require a PHP version of a certain value to work properly. Moreover, each new version of PHP comes with the latest security patches that are vital for improving the security of your website. Hence, it is recommended that you update your server’s PHP version. You can easily update the PHP version on cPanel.

With this article, we will explain to you how to update PHP version on cPanel easily without any issues.

How to Update PHP Version on cPanel?

If you encounter problems when you are dealing with PHP pages or see a message on the WordPress dashboard asking you to upgrade your PHP version, you should consider updating the version immediately. 

There are 2 ways to update the PHP version. Follow any of the methods to get the task done.

Option 1: Using MultiPHP Manager

  • Log in to your cPanel account.
  • Select “MultiPHP Manager” under the software section.
  • Check the box on the left side to select the domain you want to upgrade
  • Choose the PHP version and click the “Apply” button.

You will see a pop-up message if the change you made is successful. It is advised to Double check the version of your PHP you are currently using before doing the update. This will avoid unnecessary issues associated with the process of the version update.

Option 2: Using PHP Selector

  • Log in to your cPanel Account.
  • Select “PHP selector” from the software section.
  • Navigate to the root directory of the website which will be named “public_html” for your primary site.
  • Here you will see a drop-down to select the PHP version. Select the version from the dropdown and click “update“.

The update will be recursively applied when you are choosing the PHP selector for your version update. That is, if you made any update to the directory, all subdirectories will be subjected to the update. You should need to navigate the root document for an addon domain and should select an appropriate PHP version to use different versions of PHP for an addon domain.

Check the Current Version Using phpinfo.php page

You can create a PHP info page in the root directory to confirm whether the updates are successful or not. Creating a PHP info page is easy. Follow the steps to create it on your own.

  • Log in to your cPanel.
  • Select the “File Manager” from “Files”.
  • Choose “public_html” from the list that appears.
  • Select “File” from the top right corner.
  • Enter a name for your info page, for convenience, you can name it as “phpinfo.php“.
  • Select “create new file“.
  • right-click on phpinfo.php and select “Edit“.
  • Enter the given code to your phpinfo.php file to show installed modules.

          <?php

              phpinfo(info_modules); 

           ?> 

  • Save changes.

To view the phpinfo.php file you created,

  • Open your web browser
  • Enter the following to your browser tab with your domain name.
        http://example.com/phpinfo.php

You can now view the current PHP version your site is using. Creating the info page before proceeding with the update process will help you to note the current version of PHP you are using. This will allow you to make sure the updates are done successfully. If you find issues after the update, recheck the entire process or contact the cPanel management service provider for support.

Related Article: Your PHP Installation Appears to be Missing the MySQL Extension Which is Required by WordPress

Final Thoughts

Keeping the old versions of PHP on your site acts as an invitation to cyber attacks. Every PHP version update brings some fantastic feature that makes your site more secure and efficient. Many people are unaware of the importance of PHP version updates. But as a server management company that provides cPanel server management services for many companies around the world, we suggest our customers check the PHP version of their site and confirm if it is running on an updated version of PHP or not. If yes, try to update it soon as possible. 

This article will guide you with simple steps to update PHP version on cPanel on your own. If you are not successful in updating the PHP version, you can contact our cPanel support team. Our expert services will be available round the clock to assist you.

Related Article: Error Establishing a Database Connection in WordPress