• Luni, August 24, 2020

How to Change Your Website's PHP Version on Quality Hosting

We can say that PHP is one of the most powerful programming languages ​​currently available. It is used in the development of web applications and websites. It is an open-source language, which allows everyone to develop and modify it to fit their website. This widespread usage is evident in the fact that PHP powers the largest social networking platform in the world, Facebook, as well as the largest encyclopedia in the world, Wikipedia.

You can change the PHP version to the latest to suit your website and accommodate all web applications. This can be done through the Qpanel or Cpanel control panel, which provides a very important tool called PHP Selector. This tool allows you to change the PHP version to the latest. You can also change the PHP version through the htaccess file.

In this article, we will explain in detail with illustrative images how to use this tool and how to change the PHP version.


Updating the Version Using PHP Selector:

First, log in to the Quality Hosting customer area and access the Qpanel control panel. Then, click on "Select PHP Version" indicated in the image under the SOFTWARE menu.

لغة البرمجة PHP

Now, you can choose the version that suits your website and is compatible with web applications from the dropdown menu to select the version shown in the image. After selecting the desired version, click "Save" to automatically save the new version.

لغة البرمجة PHP

لغة البرمجة PHP


Changing PHP Version via htaccess File:

Log in to cPanel control panel, then click on the public_html file and show hidden files by clicking on "Settings" and choose "Show Hidden Files".

لغة البرمجة PHP

After that, you will see the htaccess file, open it, and add this code:

AddHandler application/x-httpd-php5 .php

Once you place the number 5 next to PHP, the version will become 5.0.

For each specific version, place it directly after PHP:

AddHandler application/x-httpd-php7 .php

AddHandler application/x-httpd-php71 .php

AddHandler application/x-httpd-php72 .php

AddHandler application/x-httpd-php73 .php

AddHandler application/x-httpd-php74 .php

AddHandler application/x-httpd-php80 .php

AddHandler application/x-httpd-php81 .php

AddHandler application/x-httpd-php82 .php

You can change the PHP version whenever you want and revert to the old version using the same process. We always recommend using the latest version of PHP due to its support and improvements over older versions.

If you have any questions, feel free to leave a comment, and the Quality team will respond as soon as possible.