在 IIS7 集群上运行的 PHP 上调试 500 内部服务器错误

2021-12-19 00:00:00 iis-7 php iis

最近我的 ISP 将我们的网站切换到 IIS7.0 高可用性集群.该网站在 PHP5.2.1 上运行,我只能上传文件(因此没有注册表调整).我之前测试过该网站,一切似乎都在运行,但现在结帐页面失败了:

<块引用>500内部服务器错误.您要查找的资源有问题,无法显示.

随着错误消息的出现,这不是很有用.我试过了:

ini_set('display_errors', 1);ini_set('error_log', $file_php_can_write_to );

但两者似乎都没有做任何事情.

有人知道如何获得更好的调试输出吗?

解决方案

Edit : 看起来我们有一个 serverfault 中的类似问题.检查一下

关闭 IIS7 自定义错误将允许将来自您的应用程序的错误响应发送到远程客户端,而不会被 IIS7 的自定义错误模块审查.

您可以通过运行开始>运行>inetmgr.exe"从 IIS7 管理工具执行此操作,在左侧树视图中选择您的网站/应用程序/虚拟目录,单击错误页面"图标,单击编辑功能设置"操作,然后选择详细错误"

来源

Recently my ISP switched our website to an IIS7.0 high availibility cluster. The website is running on PHP5.2.1 and I can only upload files (so no registry tweaks). I had tested the website before and everything seemed to be working, but now the checkout page fails with:

500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.

As error messages go, this isn't very informative. I've tried:

ini_set('display_errors', 1);
ini_set('error_log', $file_php_can_write_to );

but both don't seem to do anything.

Anyone know how to get better debugging output?

解决方案

Edit : Looks like we have a similar question in serverfault. Check it out

Turning off IIS7 custom errors will allow error responses from your application to be sent to remote clients without being censored by the IIS7’s custom errors module.

You can do this from the IIS7 Admin tool by running "Start>Run>inetmgr.exe", selecting your website/application/virtual directory in the left-hand tree view, clicking on the "Error Pages" icon, clicking "Edit Feature Settings" action, and then selecting "Detailed Errors"

Source

相关文章