I'm trying to load an HTML file containing php script inside it. It is hosted in IIS 7.5. Here is the HTML file :

<!DOCTYPE html>
<html>
<body>
<H1>test</H1>

<?php
echo "My first PHP script!";
?>

</body>
</html>

I've hosted this page as a web application inside IIS. My web.config is as below:

<?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>

When I browse the html file in browser it results in following error:

HTTP Error 500.21 - Internal Server Error Handler "PHP53_via_FastCGI_HTML" has a bad module "FastCgiModule" in its module list

I've double checked following things:

  1. CGI component is already installed in windows components/features in control panel.
  2. ApplicationHost.config file of IIS containing following add tag inside <globalModules> tag:

    add name="FastCgiModule" image="%windir%\System32\inetsrv\iisfcgi.dll"

  3. ApplicationHost.config file of IIS is containing following add tag inside <Modules> tag:

    add name="FastCgiModule"

Still I'm getting above mentioned error. Can anyone help me what I'm missing now?

Related posts

Recent Viewed