You have a couple of choices here. You can make either of these changes in your httpd.conf file. Of course you will need to replace /var/www/html/simpleshophp with the location of your store:
# This change makes it possible to include PHP code
# directly in an .html file
<Directory /var/www/html/simpleshophp>
<Files *.html>
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 524288
</Files>
</Directory>
I like this one; it makes Apache2 work very much the way Apache 1.3.x used to work.
Here is an alternative, which is even simpler:
<Directory /var/www/html/simpleshophp> DirectoryIndex main.php </Directory>
This will make Apache look for a file named main.php instead of index.html, and serve that as the "index" page for our store directory. That's the approach we take in the rest of our examples; you'll note that all the pages are called something.php rather than something.html.
You also need to be sure that Apache will run .php pages through the PHP interpreter; that is done in Apache2 by "including" a conf.php file, which Red Hat 8 puts into /etc/httpd/conf.d
If you're curious, this is what the /etc/httpd/conf.d/conf.php file looks like:
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
LoadModule php4_module modules/libphp4.so
#
# Cause the PHP interpreter to handle files with a .php extension.
#
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 524288
</Files>
Why not make Apache run all your .html files through PHP? That used to be the default under Apache 1.3.x, and I tried to get Apache 2 to do the same; but every time I had any kind of error, the httpd child process that encountered the error condition blew up. It's gotten better, but if you're setting up from scratch, why risk it? Bite the bullet and call your PHP pages "something.php" instead of "something.html." If you already have an "index.html" in the search engines, you can replace it with one that redirects visitors to main.php instead. Here's a sample that does a redirect in zero seconds, which should be invisible to the user. It also provides a link to click, just in case the visitor's browser is weird and ignores the redirect:
<html><head><title>Welcome</title> <meta http-equiv="refresh" content="0;url=http://example.com/main.php"> </head> <body bgcolor="#CFCFCF"> <h1>Welcome to ExampleCo</h1> <a href="http://example.com/main.php">Enter</a> </body>/html>