Follow the steps below if you only want to change the PHP version of one addon domain or subdomain. This guide applies to cPanel accounts that host multiple websites and domains.
This process involves editing the .htaccess file of your website that may result in a downtime of your website if done incorrectly. It is best to ask your website developer to follow the suggested steps below.
- Access your cPanel.
- Under Files, click File Manager.
- Create and view your phpinfo.php page to compare the PHP version before and after completing this guide.
- Edit the .htacccess file of the website in question. If you can’t see the .htaccess file, show .htaccess (hidden files) within the File Manager.
If you still can’t see the .htaccess file even after showing the hidden files, create a .htaccess file.
- Enter the code that corresponds to the PHP version you want to apply based on the table below.
AddHandler application/x-httpd-ea-php55___lsphp .php .php5 .phtml
AddHandler application/x-httpd-ea-php56___lsphp .php .php5 .phtml
AddHandler application/x-httpd-ea-php70___lsphp .php .php7 .phtml
AddHandler application/x-httpd-ea-php72___lsphp .php .php7 .phtml
AddHandler application/x-httpd-alt-php74___lsphp .php
AddHandler application/x-httpd-alt-php80___lsphp .php
AddHandler application/x-httpd-alt-php81___lsphp .php
AddHandler application/x-httpd-alt-php82___lsphp .php
Add the code to the topmost part of the page if there are existing codes in the .htaccess file.
- Click Save Changes on the file editor.
- View the changes in your phpinfo.php file that you created in Step 2 by adding /phpinfo.php after your domain name. It should be similar to this URL: https://yourdomain.com/phpinfo.php when accessing it via your browser.