PHP 上的 FastCGI 中的错误 500
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17489820/
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
Error 500 in FastCGI on PHP
提问by Walter Gandarella
I recently changed server. This my new server using FastCGI to interpret PHP. However, much that I brought from the old server is giving this error again, and the problem is that FastCGI does not return the error to debug, it just returns a "500 internal server error".
我最近换了服务器。这是我使用 FastCGI 解释 PHP 的新服务器。但是,我从旧服务器带来的很多内容再次出现此错误,问题在于 FastCGI 不会返回错误进行调试,它只会返回“500 内部服务器错误”。
With that I'm not exactly sure what line to correct the error occurred. I have scripts immense, which makes unfeasible review the entire a Code.
有了这个,我不确定发生了哪一行来纠正错误。我有大量的脚本,这使得整个代码变得不可行。
Already tried using
已经尝试使用
try {.. }
尝试 {.. }
in known errors, but still FastCGI returns the 500 error.
在已知错误中,但 FastCGI 仍然返回 500 错误。
I'm not a server administrator to power on mecher environment variables, is there any way to work around these errors from within PHP?
我不是启用 mecher 环境变量的服务器管理员,有什么方法可以在 PHP 中解决这些错误?
采纳答案by Robert
This error may be cause because you didn't set the proper permissions for the directory.
此错误可能是因为您没有为目录设置适当的权限。
You should set the proper permissions and then try run the script. It should work.
您应该设置适当的权限,然后尝试运行脚本。它应该工作。
Try running simple php file to see if it shows this error. If so then change permissions. If not then check the logs because the problem may be in your script.
尝试运行简单的 php 文件以查看它是否显示此错误。如果是,则更改权限。如果没有,请检查日志,因为问题可能出在您的脚本中。
You can also set display_errors to 1 in php.ini, htaccess or inside script
您还可以在 php.ini、htaccess 或内部脚本中将 display_errors 设置为 1
in php.inilook for error_reporting
and display_errors
在php.ini 中查找error_reporting
和display_errors
error_reporting = E_ALL
display_errors = 1
回答by IvanJijon
I had the same error, I had the proper permissions.
我有同样的错误,我有适当的权限。
What fixed my problem was to download Visual C++ Redistributable for Visual Studio 2012 Update 4 x86.
解决我的问题的是下载 Visual C++ Redistributable for Visual Studio 2012 Update 4 x86。
I have PHP in x86so I downloaded VSU_4\vcredist_x86.exe.
我在 x86 中有PHP,所以我下载了VSU_4\vcredist_x86.exe。
I had just x64 before solving my issue. Installing VSU_4\vcredist_x86.exe solved the problem and now I have both.
在解决我的问题之前,我只有 x64。安装 VSU_4\vcredist_x86.exe 解决了这个问题,现在我两者都有。
I hope it helps!
我希望它有帮助!
Yo can download VSU_4\vcredist_x86.exe here: http://www.microsoft.com/en-us/download/details.aspx?id=30679
你可以在这里下载 VSU_4\vcredist_x86.exe:http: //www.microsoft.com/en-us/download/details.aspx?id=30679
回答by Wesley van Dijken
Put this inside your code, it'll turn error reporting on.
把它放在你的代码中,它会打开错误报告。
ini_set('display_errors',1);
error_reporting(E_ALL);