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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1696867/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 03:32:49  来源:igfitidea点击:

Debugging 500 Internal Server Error on PHP running on IIS7 cluster

phpiisiis-7

提问by Matthijs P

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:

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

500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.
500内部服务器错误。您要查找的资源有问题,无法显示。

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?

任何人都知道如何获得更好的调试输出?

回答by Shoban

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

编辑:看起来我们在 serverfault 中类似的问题。一探究竟

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.

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

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”

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

Source

来源

回答by RGA

It's very common when you change server you cannot load your apps. I have solved this problem running php.exeinstead of loading your apps on the browser:

当您更改服务器时,您无法加载应用程序是很常见的。我已经解决了运行php.exe而不是在浏览器上加载您的应用程序的问题:

1) Run it using the Command line > C:\php\php.exeOR

1)使用命令行> C:\php\php.exe或运行它

2) Run Windows Explorer, look for it, and double click on c:\php\php.exe.

2) 运行Windows Explorer,寻找它,然后双击c:\php\php.exe

3) You are gonna see what DLL's are having conflicts and causing the 500 error.

3) 您将看到哪些 DLL 存在冲突并导致 500 错误。

4) Solve the conflicts finding the right DLL's for your windows version and you should be able to see your apps through the browser.

4) 解决为您的 Windows 版本找到正确 DLL 的冲突,您应该能够通过浏览器看到您的应用程序。

The best of the lucks.

最好的运气。

回答by Chris Sobolewski

IIS does this, it's really annoying and I could not find a fix, which is what caused me to switch to an Apache server for my local machine. Unfortunately, if you don't have control over your server, the best you can do is either test it locally on an apache set up or ask your host to allow the error messages.

IIS 这样做,这真的很烦人,我找不到修复程序,这就是导致我切换到本地计算机的 Apache 服务器的原因。不幸的是,如果您无法控制您的服务器,那么您能做的最好的事情就是在 apache 设置上本地测试它或要求您的主机允许错误消息。

I did some googling, thisthis looks like what you need. Wish that was around when I was trying to get IIS running.

我做了一些谷歌搜索,看起来像你需要的。希望在我试图让 IIS 运行时就这样。