🍁 Autumn Sale — Up to 70% discount for hosting and domains
activate now
Frequently Asked Questions • Dev

How can I make .html files be interpreted as .php files by the server?

In this article, you will learn the procedure by which .html files are interpreted as .php files by the server.

Views 830Updated 6 aniPublished on 22/01/2019by Florin P.

Shared server steps

In order for the server to interpret .html files as .php files, it is necessary to add the lines below in the .htaccess file in the directory where the .html file is located or in the root directory of the hosting account.

AddHandler application/x-httpd-ea-php56-lsphp /opt/cpanel/ea-php56/root/usr/bin/lsphp .html
#AddHandler application/x-httpd-ea-php70-lsphp /opt/cpanel/ea-php70/root/usr/bin/lsphp .html
#application/x-httpd-ea-php71-lsphp /opt/cpanel/ea-php71/root/usr/bin/lsphp .html
#application/x-httpd-ea-php72-lsphp /opt/cpanel/ea-php72/root/usr/bin/lsphp .html

We will uncomment the line specific to the PHP version that is set in the cPanel account, in our case PHP 5.6.

VPS Server cPanel Steps

#AddHandler application/x-httpd-ea-php56 /opt/cpanel/ea-php56/root/usr/sbin/php-fpm .html
AddHandler application/x-httpd-ea-php70 /opt/cpanel/ea-php70/root/usr/sbin/php-fpm .html
#AddHandler application/x-httpd-ea-php71 /opt/cpanel/ea-php71/root/usr/sbin/php-fpm .html
#AddHandler application/x-httpd-ea-php72 /opt/cpanel/ea-php72/root/usr/sbin/php-fpm .html

We will uncomment the specific line for the PHP version that is set in the cPanel account, in our case PHP 7.0.

Similar Articles

Views 830
Updated 6 years ago

In this article, you will learn the procedure by which .html files are interpreted as .php files by the server.

Views 921
Updated 7 years ago

Learn how to set a PHP cron job and the paths to the PHP interpreter on Webuzo, cPanel/WHM, and Plesk. Find quick and effective solutions for VPS.

Views 1,497
Updated 1 year ago

Learn what the php.ini file is and how to modify it on different types of hosting. Tutorials for shared and VPS, including PHP settings.