How to change PHP versions & settings in cPanel Linux?

Disclaimer: The views expressed here are solely those of the author in his/her private capacity. Freshticles is a platform where users from all walks of life share their opinion freely. If you want to contribute to WriMy, please connect with us

Changing the PHP Version:

For changing the PHP version, follow the below mentioned steps:

  • Log in to cPanel.
  • In the Software segment of the cPanel main window, hit Select PHP Version option:
  • Once you hit the select PHP version option cPanel shows the current version of PHP. If you want to change the version of PHP, in the PHP version list, look for the version you want to change to and select it and then hit set as current:

The version you updated to takes effect immediately.

Changing PHP Setting in cPanel

Using cPanel you can change various PHP setting easily. You can enable or disable file upload, as well as you can perform configuration related tasks like display_errors, include_path, log_errors, memory_limit and many more.

To change the PHP settings from cPanel, follow these steps:

Log in to cPanel account.

  • From the main screen of cPanel, search for software area, click select PHP version:
  • Click Switch To PHP Options:
  • On this step you can change the setting based on your needs:
  • Once you are done, click save button.

If you find any difficulty in changing PHP settings feel free to contact our support team, we will do it for you.

Choosing the PHP Version in cPanel Host Services

Know more about PHP version

PHP is a general-purpose scripting language that’s particularly suited to server-side web development, in most case PHP generally runs on a web server. Any PHP code in a requested file is executed based on the PHP runtime, typically to create a dynamic website content or dynamic pictures used on websites or elsewhere.

The PHP software works with the web server. It is the software that delivers web content to the globe. When you request a file, the web server happens to be running PHP, and it sends HTML back to the browser.

Basic information about cPanel PHP?

cPanel is a web-based control panel tool which will help you to assist to manage your web hosting account through a web interface rather than a console. With the help of best cPanel hosting, you will be able to accomplish your tasks quickly and even non-professional. It will simply set the websites through cPanel hosting.

Steps to Change the PHP Version in a cpanel:

Step-1: Login to cpanel

Step-2: Click on Select PHP Version in software section

Step-3: In the PHP Selector/Extension page:

==>Click the PHP version drop-down menu button and select the required version

==>And click on Set As Current

==>You can also select additional features and click on the Save button

Step-4: You can switch to PHP options for more features

==>You will find the PHP Selector/options page like mentioned in the below screenshot.

==>You can make any changes in the option provided based on your requirements and click on Save button.

Before Upgrading PHP versions remember these points:

  1. First, you need to make sure that any libraries that your PHP project uses are available for PHP 7. If the libraries do not yet support PHP 7, you may have to hold off on upgrading for a while, or see if it is possible to remove dependence on those libraries.
  1. If your code is written in PHP 5.5 or PHP 5.6, then upgrading will likely be straightforward. However, if you use PHP 4, then there are some syntax changes that you should be aware of. For example, the old style of constructor functions employed in PHP 4 is not supported in PHP 7, even though these constructors worked in PHP 5.
  1. When upgrading to PHP 7, it is best to ensure that your code includes tests, such as unit and integration tests. These tests should catch any issues with your application before they show up as bugs in a live environment.

Steps to Upgrade PHP Version:

Step1: Login to server as a root user:

It will take around 1 hour for PHP multiple versions installation. Once it is done login to cPanel and Go to PHP version where you can see the Versions under drop-down menu. You can select the appropriate versions for your projects.