Tom Sterns's picture

I would like to configure apache to execute php scripts w/in .html documents.

i.e. this text in a file named phptest.hrml:

<html>

    <head>
        <title>PHP in HTML Test</title>
    </head>
    <body>
        <ul>
            <?php for($i=1;$i<=5;$i++){ ?>
            <li>Menu Item #<?php echo $i; ?></li><?php } ?>
        </ul>
    </body>
</html>
 

Have tried multiple variations of .htaccess with no luck.

Seems like this sould be pretty straight forward.

Forum: 
Tags: 
Jeremy Davis's picture

If you rename the file phptest.php the html will still work fine and so will the php. Should then just work OOTB - no apache config required...

Add new comment