PHP tag is not working in my index.html file
But if I change index.html
to index.php
then it prints the app.js
code on index file.
PHP tag is not working in my index.html file
But if I change index.html
to index.php
then it prints the app.js
code on index file.
What web server are you using? Your web server is probably not configured to run PHP files with an html
extension.
According to the answer from this question, you can configure Apache to run files with an html
extension as PHP using a .htaccess
file.
Create a .htaccess file at the root of your website and add this line:
[Apache2 @ Ubuntu/Debian: use this directive]
AddType application/x-httpd-php .html .htm