You can use php code in files with extension .php and only there (iff other is not defined in your server settings).
Just rename your file *.html to *.php
If you want to allow php code processing in files of different format, you have two options to do that:
1) Modifying httpd.conf to allow this for all projects on your server, by adding:
AddHandler application/x-httpd-php .htm .htmlAddType application/x-httpd-php .html
2) Creating .htaccess file in your separate project top directory with:
AddHandler application/x-httpd-php .htm .html
AddType application/x-httpd-php .html
For second option you need to allow use of .htaccess files in your httpd.conf, by adding the following settings:
AllowOverride All
AccessFileName .htaccess
The option application/x-httpd-php varies depending on PHP version. You can get the details from the configuration file - /usr/local/apache/conf/php.conf. For ex, in PHP5 the extension will be of format,
application/x-httpd-php5
Just rename your file *.html to *.php
If you want to allow php code processing in files of different format, you have two options to do that:
1) Modifying httpd.conf to allow this for all projects on your server, by adding:
AddHandler application/x-httpd-php .htm .htmlAddType application/x-httpd-php .html
2) Creating .htaccess file in your separate project top directory with:
AddHandler application/x-httpd-php .htm .html
AddType application/x-httpd-php .html
For second option you need to allow use of .htaccess files in your httpd.conf, by adding the following settings:
AllowOverride All
AccessFileName .htaccess
The option application/x-httpd-php varies depending on PHP version. You can get the details from the configuration file - /usr/local/apache/conf/php.conf. For ex, in PHP5 the extension will be of format,
application/x-httpd-php5