FAQ

PHP Version on a Per-Directory Basis

When hosting multiple domains or applications inside a single account, you may need to run different PHP versions side by side. You can easily override the PHP version on a per-directory basis.

Follow these steps to change the PHP version for a specific directory:

  1. Create or open the .htaccess file inside the directory where you want to customize the PHP version.
  2. Copy the preferred handler directive from the list below into your .htaccess file and save it.

Select PHP Version

PHP 8.3

AddType application/x-httpd-alt-php83___lsphp .php5 .php4 .php .php3 .php2 .phtml

PHP 8.2

AddType application/x-httpd-alt-php82___lsphp .php5 .php4 .php .php3 .php2 .phtml

PHP 8.1

AddType application/x-httpd-alt-php81___lsphp .php5 .php4 .php .php3 .php2 .phtml

PHP 8.0

AddType application/x-httpd-alt-php80___lsphp .php5 .php4 .php .php3 .php2 .phtml

PHP 7.4

AddType application/x-httpd-alt-php74___lsphp .php5 .php4 .php .php3 .php2 .phtml

PHP 7.3

AddType application/x-httpd-alt-php73___lsphp .php5 .php4 .php .php3 .php2 .phtml

PHP 7.2

AddType application/x-httpd-alt-php72___lsphp .php5 .php4 .php .php3 .php2 .phtml

PHP 7.1

AddType application/x-httpd-alt-php71___lsphp .php5 .php4 .php .php3 .php2 .phtml

PHP 7.0

AddType application/x-httpd-alt-php70___lsphp .php5 .php4 .php .php3 .php2 .phtml

PHP 5.6

AddType application/x-httpd-alt-php56___lsphp .php5 .php4 .php .php3 .php2 .phtml

PHP 5.5

AddType application/x-httpd-alt-php55___lsphp .php5 .php4 .php .php3 .php2 .phtml

PHP 5.4

AddType application/x-httpd-alt-php54___lsphp .php5 .php4 .php .php3 .php2 .phtml

PHP 5.3

AddType application/x-httpd-alt-php53___lsphp .php5 .php4 .php .php3 .php2 .phtml

PHP 5.2

AddType application/x-httpd-alt-php52___lsphp .php5 .php4 .php .php3 .php2 .phtml

PHP 5.1

AddType application/x-httpd-alt-php51___lsphp .php5 .php4 .php .php3 .php2 .phtml

PHP 4.4

AddType application/x-httpd-alt-php44___lsphp .php5 .php4 .php .php3 .php2 .phtml

Account-Wide PHP Version

Alternatively, you can configure the default PHP version for your entire account in cPanel. See our guide on Changing PHP Version / Modules .