Is it possible to include php in html on IIS7?

It seems to be possible in Apache,

enable php script inside HTML

But can I make iIS 7 parse html files for php? My html files currently allow asp, as it would be great if I could just do it with a php file.

My server runs .php files, as you would expect.

I tried to add a handler mapping in IIS with the same values ​​as the * .php mapping that was created with my IIS / PHP installation, only for * .html

This did not work, then I added a handler to my web.config file

<add name="PHP_via_FastCGI" path="*.html" verb="*" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\v5.3\php-cgi.exe" resourceType="Either" requireAccess="Script" />

and that hasn’t changed anything.

When launching an html file with php code, there are no errors in it, the code simply does not start.

Suppose I just can't just change my index.html to index.php.

+5
source
1

, apache IIS, .php .html. ( ) web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <handlers>
            <add name="PHP53_via_FastCGI_HTML" path="*.html" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\v5.3\php-cgi.exe" resourceType="File" requireAccess="Script" />
        </handlers>
    </system.webServer>
</configuration>

? , web.config, , , , </rant>

+7

All Articles