How to Make .html Files Processed as .php Files

Updated on Jun 11, 2019

To perform such change you need to know which version of PHP is running on your account. In order to acquire this information you should follow these steps:

  • Access your cPanel account
  • Choose the Select PHP Version icon from the Software and Services section.

After you are sure which PHP version is currently running on your account you should access the .htaccess file of your application which you can perform easily via:

  • Access your cPanel account main dashboard
  • Locate the File Manager icon from the Files section. Mind the pop-up window and select the Web Root(public_html/www) and Show Hidden Files(dotfiles) options on it. When ready, click on the Go button.

Navigate to the desired folder where your application is installed and locate the .htaccess file (if there is no such file, create it). After you click on the .htaccess file, select it and then click on the Edit button at the top. This will open the mentioned file in a simple text editor where you will be able to perform changes on it. Depending on the current PHP version, which you have already checked you should apply one and only one of the following lines at the top of the file:

# If you are using PHP 5.3, add the following line:
AddType application/x-lsphp53 .php5 .php4 .php .php3 .php2 .phtml

# If you are using PHP 5.4, add the following line:
AddType application/x-lsphp54 .php5 .php4 .php .php3 .php2 .phtml

# If you are using PHP 5.5, add the following line:
AddType application/x-lsphp55 .php5 .php4 .php .php3 .php2 .phtml

# If you are using PHP 5.6, add the following line:
AddType application/x-lsphp56 .php5 .php4 .php .php3 .php2 .phtml

We hope you find this article useful. Discover more about FastCloud - the top-rated Hosting Solutions for personal and small business websites in four consecutive years by the HostAdvice Community!

SSD Cloud Hosting

  • Free Domain Transfer
  • 24/7 Technical Support
  • Fast SSD Storage
  • Hack-free Protection
  • Free Script Installation
  • Free Website Transfer
  • Free Cloudflare CDN
  • Immediate Activation
View More