Apache 内部错误 500,但日志中没有任何内容? [英] Internal Error 500 Apache, but nothing in the logs?

查看:39
本文介绍了Apache 内部错误 500,但日志中没有任何内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试向应用程序中的特定地址发送 HTTP POST 时,我收到 500 个内部服务器错误.我查看了虚拟主机文件中指定的自定义日志目录中的服务器日志,但错误没有出现在那里,所以调试这很麻烦.

I'm getting 500 Internal Server errors when I try to make an HTTP POST to a specific address in my app. I've looked into the server logs in the custom log directory specified in the virtual hosts file, but the error doesn't show up there so debugging this has been a pain in the ass.

如何让 Apache 将内部 500 错误记录到错误日志中?

How do I cause Apache to log Internal 500 errors into the error log?

推荐答案

请注意: 原发帖人并未专门询问 PHP.所有以 php 为中心的答案都做出了与实际问题无关的大假设.

Please Note: The original poster was not specifically asking about PHP. All the php centric answers make large assumptions not relevant to the actual question.

与脚本错误日志相反,默认错误日志通常具有(更多)特定错误.通常是权限被拒绝,甚至是找不到解释器.

The default error log as opposed to the scripts error logs usually has the (more) specific error. often it will be permissions denied or even an interpreter that can't be found.

这意味着错误几乎总是出在您的脚本上.例如,您上传了一个 perl 脚本,但没有授予它执行权限?或者它可能在 linux 环境中被损坏,如果您在 windows 中编写脚本然后将其上传到服务器而不转换行尾,您将收到此错误.

This means the fault almost always lies with your script. e.g you uploaded a perl script but didnt give it execute permissions? or perhaps it was corrupted in a linux environment if you write the script in windows and then upload it to the server without the line endings being converted you will get this error.

如果你忘记了在 perl 中

in perl if you forget

print "content-type: text/html\r\n\r\n";

你会得到这个错误

有很多原因.所以请先检查您的错误日志,然后提供更多信息.

There are many reasons for it. so please first check your error log and then provide some more information.

默认错误日志通常在 /var/log/httpd/error_log/var/log/apache2/error.log 中.

The default error log is often in /var/log/httpd/error_log or /var/log/apache2/error.log.

您查看默认错误日志的原因(如上所示)是因为错误并不总是如虚拟主机中定义的那样发布到自定义错误日志中.

The reason you look at the default error logs (as indicated above) is because errors don't always get posted into the custom error log as defined in the virtual host.

假设是 linux 而不一定是 perl

Assumes linux and not necessarily perl

这篇关于Apache 内部错误 500,但日志中没有任何内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆