Lac*_*ose 5 php iis asp-classic
似乎可以在Apache中这样做,
但我可以让我的IIS 7解析PHP的HTML文件?目前我的html文件允许asp包括像是如果我可以用php文件那样精彩.
我的服务器像你期望的那样运行.php文件.
我尝试过在IIS中添加一个Handler Mapping,其值与使用我的IIS/PHP安装创建的*.php映射相同,仅切换为*.html
这没用,然后我在web.config文件中添加了一个处理程序
<add name="PHP_via_FastCGI" path="*.html" verb="*" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\v5.3\php-cgi.exe" resourceType="Either" requireAccess="Script" />
Run Code Online (Sandbox Code Playgroud)
像这样,并没有改变任何东西.
当我运行带有php代码的html文件时没有错误,代码只是不运行.
让我们假设我不能简单地将index.html更改为index.php.
我必须让这个工作从一个从apache迁移到IIS的站点,它使用了混合的脚本.php和.html脚本.我在web.config中有这个(裁剪无用的东西):
<?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>
Run Code Online (Sandbox Code Playgroud)
你有没有在正确的部分?我讨厌我看到的大多数web.config示例实际上并没有告诉你他们应该在哪个部分</rant>
| 归档时间: |
|
| 查看次数: |
4310 次 |
| 最近记录: |