1. Home
  2. Website
  3. PHP
  4. How to set a different PHP version for an Addon Domain

How to set a different PHP version for an Addon Domain

Neoxea uses CloudLinux as the operating system on our servers to enhance stability, performance, and account isolation.

One of the key benefits of CloudLinux is that each hosting account can choose the PHP version required for its websites. This is especially useful when running applications that depend on a specific PHP version.

However, one limitation is that cPanel does not allow you to assign different PHP versions directly to individual Addon Domains or Subdomains from the interface.

Although this option is not available directly in cPanel, you can still configure a different PHP version for an Addon Domain, Subdomain, or even a specific folder by adding the appropriate PHP handler to the website’s .htaccess file.

To change the PHP version for a specific location in your account, simply add one of the following handlers to the corresponding .htaccess file, depending on the PHP version you want to use.

If you want to set a global PHP version for all your domains inside your cPanel, you can easily do so using the Select PHP Version feature in cPanel.

Available PHP handlers:

Add only one line to .htaccess file.

PHP 5.6

AddHandler application/x-httpd-alt-php56 .php .php7 .phtml

PHP 7.0

AddHandler application/x-httpd-alt-php70 .php .php7 .phtml

PHP 7.1

AddHandler application/x-httpd-alt-php71 .php .php7 .phtml

PHP 7.2

AddHandler application/x-httpd-alt-php72 .php .php7 .phtml

PHP 7.3

AddHandler application/x-httpd-alt-php73 .php .php7 .phtml

PHP 7.4

AddHandler application/x-httpd-alt-php74 .php .php7 .phtml

PHP 8.0

AddHandler application/x-httpd-alt-php80 .php .php8 .phtml

PHP 8.1

AddHandler application/x-httpd-alt-php81 .php .php8 .phtml

PHP 8.2

AddHandler application/x-httpd-alt-php82 .php .php8 .phtml

PHP 8.3

AddHandler application/x-httpd-alt-php83 .php .php8 .phtml

PHP 8.4

AddHandler application/x-httpd-alt-php84 .php .php8 .phtml

PHP 8.5

AddHandler application/x-httpd-alt-php85 .php .php8 .phtml

Leave a Comment