360°网站管家_运维学院_提供最新最全的服务器运维视频教程与网站维护视频教程

 找回密码
 快速注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
1 2 3 4
查看: 2809|回复: 0
打印 上一主题 下一主题

IIS里为zendcore添加.htm或.html后缀按php程序执行

[复制链接]

823

主题

909

帖子

4623

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
4623
跳转到指定楼层
楼主
发表于 2015-9-26 14:24:07 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

亲!这问题您也搜索很久了吧?不如咨询下我们吧


613049616  613049616  613049616   613049616   613049616


如何在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.
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 快速注册

本版积分规则


Archiver|手机版|小黑屋|360wzgj Inc. 百度统计

GMT+8, 2024-11-23 05:05 , Processed in 0.069116 second(s), 31 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表