I am a newbie and have never used PHP before. I want to execute PHP script from an HTML file on Linux. What do I need to do?
This is the content of my HTML file:
What output do you receive? Does it just show the PHP code?
I assume that's the case.
For a test, change the extension on the file to .php
and run it again. Does it work now?
If so, you will need to associate PHP with .html
and .htm
files on your server.
EDIT
This is the line you want to add to your Apache config:
AddType application/x-httpd-php .html