【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误

问题描述

PHP应用突然遇见了500 The page cannot be displayed because an internal server error has occurred.错误,但是如果访问一个静态HTML页面,就可以成功。只要是PHP页面,就是500。

 

问题解答

登录App Service的Kudu站点,查看日志发现一句:  scriptProcessor could not be found in "fastCGI" application configuration. 

复制代码
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
 <System>
  <Provider Name="WWW Server" Guid="{3A2A4E84-4C21"/>
  <EventID>0</EventID>
  <Version>1</Version>
  <Level>3</Level>
  <Opcode>18</Opcode>
  <Keywords>0x100</Keywords>
  <TimeCreated SystemTime="2023-07-05T07:35:06.598Z"/>
  <Correlation ActivityID="{800003B}"/>
  <Execution ProcessID="6616" ThreadID="2832"/>
  <Computer>dw</Computer>
 </System>
 <EventData>
  <Data Name="ContextId">{8000031E-0000--}</Data>
  <Data Name="ErrorDescription">&lt;handler&gt; scriptProcessor could not be found in &lt;fastCGI&gt; application configuration</Data>
 </EventData>
 <RenderingInfo Culture="zh-CN">
  <Opcode>SET_RESPONSE_ERROR_DESCRIPTION</Opcode>
  <Keywords>
   <Keyword>RequestNotifications</Keyword>
  </Keywords>
 </RenderingInfo>
 <ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
  <EventGuid>{00E}</EventGuid>
 </ExtendedTracingInfo>
</Event>
复制代码

错误消息显示因为脚本处理器(scriptProcessor)无法找到 fastCGI 模块。 而这个 fastCGI 是通过web.config配置,从App Service的实例中获取。

接下来,查看PHP的 FastCGI 处理程序 php_cgi.exe的路径。 

然后,查看web.config中配置的路径,发现路径配置为D:\Program Files\...., 所以,尝试修改 FastCGI中 ScriptProcessor的路径为 C:\ 。 

最后,保存修改。重新访问页面返回200成功。

 

解决了 scriptProcessor could not be found in "fastCGI" application configuration 问题。

 

posted @   路边两盏灯  阅读(187)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2022-07-05 【Azure 环境】 介绍两种常规的方法来监视Window系统的CPU高时的进程信息: Performance Monitor 和 Powershell Get-Counter
点击右上角即可分享
微信分享提示