配置了PHP后,提示HTTP 404.3 - Not Found 错误

一、检查并修正 PHP FastCGI 处理程序#

1. 确保 PHP FastCGI 处理程序已添加#

打开 管理员 CMD,执行以下命令检查 PHP 是否正确映射:

%windir%\system32\inetsrv\appcmd list config /section:system.webServer/handlers

如果 *.php 没有映射到 FastCgiModule,或者指向的路径不是 d:\php7433\php-cgi.exe,那么需要手动添加:

%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers /+"[name='PHP-FastCGI', path='*.php', verb='GET,HEAD,POST', modules='FastCgiModule', scriptProcessor='d:\php7433\php-cgi.exe', resourceType='File']"

然后 重启 IIS

iisreset

web.config文件

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <staticContent>
            <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1.00:00:00" />
        </staticContent>
        <defaultDocument>
            <files>
                <clear />
                <add value="index.php" />
                <add value="index.asp" />
            </files>
        </defaultDocument>
        <httpErrors errorMode="Detailed" />
        <handlers>
            <remove name="PHP-FastCGI" />
            <add name="PHP-FastCGI" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="d:\php7433\php-cgi.exe" resourceType="File" />
        </handlers>
    </system.webServer>
</configuration>

 

作者:superip

出处:https://www.cnblogs.com/superip/p/18723566

版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。

posted @   super_ip  阅读(13)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示
more_horiz
keyboard_arrow_up light_mode palette
选择主题
menu