How can I parse html as php?

Create an .htaccess file and upload it to the root of your public_html directory. Include the following lines...

 

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html



Because these extensions will be processed as PHP with the above command, changing the permission on those file types to 755 may be necessary.

If the above line does not work use the following:

 

AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml .html .htm


or

 

AddType application/x-httpd-php .php5 .php4 .php .php3 .php2 .phtml .html .htm



If using CloudLinux lsapi /LiteSpeed API, use the following:

AddType application/x-httpd-lsphp .php5 .php4 .php .php3 .php2 .phtml .html .htm
AddHandler application/x-httpd-lsphp .php5 .php4 .php .php3 .php2 .phtml .html .htm
  • 521 Users Found This Useful

Was this answer helpful?

Related Articles

Warning: Unknown(): open_basedir restriction in effect

Basedir restriction is set for security. This most often occurs when you are calling an app...

Error: SoftException in Application(dot)cpp:303 UID of script is small than min_uid

Error: SoftException in Application.cpp:303 UID of script is small than min_uid when going...

How do I import into a MariaDB - MySQL database?

Log into your control panel and go into the MariaDB - MySQL section. Make sure you have an...

Clean - Shrink ibdata1

To shrink ibdata1 once and for all you must do the following: MySQLDump all databases into a...

Learn MariaDB

MariaDB is a drop-in replacement for MySQL. The lead developer and founder of MySQL, Michael...