By default on Apache web servers, PHP code will not execute in a file that does not have a
.php (or similar) extension. So even though you can embed PHP into a HTML file, it won’t execute when the file extension is
To change this, you can add a
.htaccess file to allow PHP execution.
Here are some examples depending on your system: