如何在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
Windows OS with IIS 6.x and Zend Core.