Integrating PHP in HTML files (Apache configuration)

Facebooktwitterredditpinterestlinkedinmail

add these lines to the httpd.conf or .htaaccess :
AddType application/x-httpd-php .html
AddType application/x-httpd-php .htm

restart apache and now you can use PHP code in HTM\HTML files like this :

<?php echo 'Hello World'; ?>

One thought on “Integrating PHP in HTML files (Apache configuration)

  1. 9. We’re a group of volunteers and starting a new scheme in our community. Your web site provided us with valuable information to work on. You have done a formidable job and our entire community will be grateful to you.

Leave a Reply to Alfonso Morak Cancel reply

Your email address will not be published. Required fields are marked *