Applies To:
[ Zend Server 4.x ]
[ Windows ]
Overview
By default only the .php extension will be parsed as PHP code by the web server. This article explains how to configure Microsoft IIS 6 for parsing other extensions as PHP. We take .html as the example for this article, other extensions can be added in a similar way. The process consists of two stages - configuring IIS to use FastCGI for .html files and configuring FastCGI to call PHP for parsing .html files.
Instructions
Configuring IIS to Use FastCGI for .html Files
- Open the IIS Management Console (C:\Windows\system32\inetsrv\iis.msc).
- Locate your Web Site, right-click it and choose Properties.
- Switch to the Home Directory tab and click Configuration. This will open the Application Configuration dialog.
- On the Mappings tab, click Add.
- Click Browse and locate your IIS FastCGI module. For Zend Server this will be:
C:\Windows\system32\inetsrv\fcgiext.dll
(you can copy the location from the .php mapping, in the Application Configuration dialog) - In the Extension field, type ".html".
- Make sure that both Script Engine and Verify that file exists checkboxes are marked.
- Click OK in all open dialogs (3 times) to confirm the changes and close them.
Configuring FastCGI to Call PHP for Parsing .html Files
- Locate the fcgiext.ini configuration file in the IIS directory (C:\Windows\system32\inetsrv\fcgiext.ini) and open it in your favorite text editor.
- Add the .html extension to the Types section and set it to use PHP as CGI application:
php=PHP
html=PHP
[PHP]
ExePath=C:\Program Files\Zend\ZendServer\bin\php-cgi.exe
EnvironmentVars=PHPRC:C:\Program Files\Zend\ZendServer\etc,PHP_FCGI_MAX_REQUESTS:10000
- Save and close the file.
Result
Create the test.html file containing simple PHP code (for example: <?php phpinfo(); ?>). Open this file in your web browser (for example: http://localhost/test.html). The output should be result of processing the test.html file by the PHP engine.
Excerpt: By default only the .php extension will be parsed as PHP code by the web server. This article explains how to configure Microsoft IIS 6 for parsing other extensions as PHP.
Original Post Date: 2009-10-23 14:09:18
Alternative Description:
By default only the .php extension will be parsed as PHP code by the web server. This article explains how to configure Microsoft IIS 6 for parsing other extensions as PHP.
Comments