iis php扩展名,IIS里为zendcore添加.htm或.html后缀按php程序执行

如何在IIS里为zendcore添加.htm或.html后缀按php程序执行?首先,需要在IIS里面设置.htm或.html的isapi为php的dll(例如: d:\ZENDCO~1\modules\isapi\ZEND_F~1.DLL ),即用php程序来执行这个后缀。其次,需要编辑zendcore的etc的fastcgi.conf,添加mime类型text/html按php执行:

Server type="text/html" CommandLine="e:\ZendCore\bin\php-cgi.exe" ConnectionTimeout="30" RequestTimeout="60" StartProcesses="8" Impersonate="1" SetEnv="PHP_FCGI_MAX_REQUESTS=10000" SetEnv="PHP_FCGI_CHILDREN=1" SetEnv="PATH=?" SetEnv="TEMP=e:\ZendCore\temp" SetEnv="OS=?" SetEnv="SystemRoot=?" SetEnv="ComSpec=?"

MinDynamicServers 8

MaxDynamicServers 16

IpcDir "e:\ZendCore\temp"

How to parse .html files as PHP in IIS.官方文档:

First you need to map .html files to the isapi Zend Core module.

1. Open IIS

2. Locate your Web Site

3. Right Mouse Click -> Properties

4. Click on 'Home Directory' Tab

5. Click Configuration button

6. Make sure you are in 'Mappings' Tab, click on 'Add' button.

7. In Executable TextBox, locate your Zend Core isapi module,

For example: "C:\Program Files\Zend\Core For Oracle\modules\isapi\zend_fcgi.dll"

8. In Extension TextBox, type .html

9. Make sure both 'Script Engine' and 'Verify that file exists'.

10. Click Ok 3 times to close all of the related menus.

After that all you have got left to do is to add the mime type of the .html files to the fastcgi.conf configuration file of Zend Core.

11. Locate the fascgi.conf configuration inside the etc directory of your zend core and open

it with your favorate text editor,

For example: C:\Program Files\Zend\Core For Oracle\etc\fastcgi.conf

As an example, Next is the default fastcgi.conf that comes with Zend Core for Oracle 1.5:

Line 1: Server type="application/x-httpd-php" CommandLine="C:\Program Files\Zend\Core For Oracle\bin\php-cgi.exe" ConnectionTimeout="30" RequestTimeout="60" StartProcesses="8" Impersonate="1" SetEnv="PHP_FCGI_MAX_REQUESTS=1000" SetEnv="PHP_FCGI_CHILDREN=1" SetEnv="PATH=?" SetEnv="TEMP=C:\Program Files\Zend\Core For Oracle\temp" SetEnv="OS=?" SetEnv="SystemRoot=?" SetEnv="ComSpec=?"

Line 2: MinDynamicServers 8

Line 3: MaxDynamicServers 16

Line 4: IpcDir "C:\Program Files\Zend\Core For Oracle\temp"

---------------------=============---------------================-------------

12. Duplicate These 4 Lines with a little change, Change the 'Server type' from

"application/x-httpd-php" to "text/html".

In the end you should have a file that contains 8 configuration lines, 4 for the regular

php mime type, and the other for the html mime type.

13 . Save & Close the file

All Done! 记得重启IIS

The information in this article applies to

Windows OS with IIS 6.x and Zend Core.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值