Need help to config Apache 2.4 to parse PHP code contained in files with .HTML extension
by guardian46w from LinuxQuestions.org on (#501V7)
My personal server crashed and forced me to upgrade all of my EOL software. I cannot now get the Apache config'd so an HTML file, with embedded PHP, is parsed as a PHP file.
CentOS version 8.1.1911
Apache version 2.4.37
PHP version 7.2.11
I have tried adding these to the httpd.conf file - with no luck:
AddHandler application/x-httpd-php .html .php
AddHandler application/x-httpd-php7 .html .php
AddHandler application/x-httpd-php72 .html .php
phpinfo().php works fine and the files I have that are .php display correctly but the .html files do not run the embedded php. I have dozens of .html files that have <?php include ***** ?> statements for adding the header, menu, and footer to the pages. I really don't want to rename them all to .php.
Any help greatly appreciated. Thanks


CentOS version 8.1.1911
Apache version 2.4.37
PHP version 7.2.11
I have tried adding these to the httpd.conf file - with no luck:
AddHandler application/x-httpd-php .html .php
AddHandler application/x-httpd-php7 .html .php
AddHandler application/x-httpd-php72 .html .php
phpinfo().php works fine and the files I have that are .php display correctly but the .html files do not run the embedded php. I have dozens of .html files that have <?php include ***** ?> statements for adding the header, menu, and footer to the pages. I really don't want to rename them all to .php.
Any help greatly appreciated. Thanks