Portal Home > Knowledgebase > Apache and PHP > Execution of HTML as PHP

Execution of HTML as PHP

To be able to handle php script in .html file , you need to add the following in the .htaccess file:

AddType application/x-httpd-php5.html

To check that the setup works you need to create the following .html file and add the following php code in it:

<head> </ head>
<? php echo "Hello world!";?>
</ body>
</ html>

Save the file named test.html and upload it to your web hosting account.

When writing the address http://domain.com/test.html in the browser you should see the message Hello World!

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Where to put CGI files (Views: 4757)

* Minimum sign up periods for cPanel Web Hosting plans: Mini - 3mo., Pro - 1mo., Biz - 1mo., cPanel Reseller Hosting, Linux VPS, Windows VPS, Managed cPanel VPS and Dedicated Servers - 1mo. secret link
Accepted payments: Credit/Debit Card, Paypal, Payza, Skrill, WebMoney, CashU, Ukash, paysafecard, Bitcoin, Perfect Money, SolidTrust Pay, OKPay, EgoPay, Western Union/MG, Wire Transfer and more.