Add Handlers To Change PHP Version

Add Handlers To Change PHP Version
Support Team
Support Team

Created: 09/10/2023 4:32 PM - Updated: 10/10/2023 5:44 PM

Add Handlers To Change PHP Version -

This article will explain how-to add a PHP handler to your .htaccess files. This is useful if you want to customize the version of PHP that runs your PHP files by directly editing your .htaccess file. If you do not wish to edit the .htaccess file, you can use the cPanel to change your PHP version.

Adding the Handler to the .htaccess File -

The PHP handler is written into the .htaccess file. The .htaccess file is a hidden file that is read by the webserver. The webserver follows any instructions contained within the file. There are many ways to access this file. For the purposes of this article, we will explain accessing it through the File Manager on the cPanel of your hosting account. You can also have or use a separate .htaccess file in any given directory if needs be.

Below are the available PHP handlers -

In order to create a specific PHP handler you need to look at your .htaccess file. If you have an existing .htaccess file then add the following handlers to it, or if not, then you will need to create one.

PHP 8.1 -

PHP Handler 8.1 Htaccess File Example

PHP 8.0 -

PHP Handler 8.0 Htaccess File Example

PHP 7.4 -

PHP Handler 7.4 Htaccess File Example

PHP 7.3 -

PHP Handler 7.3 Htaccess File Example

PHP 7.2 -

PHP Handler 7.2 Htaccess File Example

PHP 7.1 -

PHP Handler 7.1 Htaccess File Example

PHP 7.0 -

PHP Handler 7.0 Htaccess File Example

PHP 5.6 -

PHP Handler 5.6 Htaccess File Example

PHP 5.5 -

PHP Handler 5.5 Htaccess File Example

PHP 5.4 -

PHP Handler 5.4 Htaccess File Example

Download Zip File PHP handlers -

If you would like to download a zip file containing an example .htaccess file, then click on the button below:

Was this article helpful?

0 Out of 0 Marked As Helpfull

Have more questions? Please Contact Us