大文件上传时出现Apache错误500(mod

编程入门 行业动态 更新时间:2024-10-16 16:19:17
本文介绍了大文件上传时出现Apache错误500(mod_security)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

据我尝试,没有一种常见的解决方案对我有用。好吧,我的问题是,每次上传大文件(600 KB〜),使用较小的图片时,都会收到500错误消息。所以...,即使这个(。极端).htaccess文件不断发生,是的.htaccess是活动的:

As far as I've tried, none of the usual solutions works for me. Well, my problem, I'm receiving an 500 Error every time I upload a "large file" (600 KB ~), with smaller images it works fine. So..., even with this (extreme) .htaccess file it keeps happening, and yes, .htaccess are active:

upload_max_filesize = 100M post_max_size = 100M memory_limit = 128M max_input_time = 6000 max_execution_time = 6000

因此,我看一下日志并找到它(只有一行,只需将其粘贴为易于阅读的行跳):

So, I take a look at the logs and find this (is only one line, just pasted it as easy to read with line jumps):

[Mon Jul 27 17:09:28.<port> 2015] [:error] [pid 21423] [client <ip>] ModSecurity: Access denied with code 44 (phase 2). Match of "eq 0" against "MULTIPART_UNMATCHED_BOUNDARY" required. [file "/etc/httpd/conf.d/mod_security.conf"] [line "35"] [id "<another id>"] [msg "Multipart parser detected a possible unmatched boundary."] [hostname "<my host>"] [uri "<my script>"] [unique_id "<id (useless I think)"]

但是,现在我无法找到如何在以下位置编辑mod_security(具有默认配置和空的Activated_rules)配置命令(我认为)以允许上传此大文件。我正在Apache 2.4 / CentOS 7中运行PHP 5.3。

But, now I not able to find how to edit the mod_security (it has the default config, and empty activated_rules) config in order (i think) to allow this "large" file uploads. I'm running PHP 5.3 in Apache 2.4/CentOS 7.

谢谢。

推荐答案

事实上,您有一个 ModSecurity警报,这意味着您不能有空的Activated_rules文件夹,或者正在以其他方式包含规则。

The fact you have a ModSecurity alert means that you can't have empty activated_rules folder or you are including the rules in some other way.

有此错误的ModSecurity已知问题似乎很容易出现误报。

There are known problems with ModSecurity for this error and it seems very susceptible to false positives.

当我裁定产生过多误报时的主要建议就是关闭该规则(我假设这是规则200003,但会根据需要替换ID):

The main advice when I rule is raising too many false positives is to just turn off that rule (I'm assuming it's rule 200003 that's firing but replace the id as appropriate):

SecRuleRemoveById 200003

更多推荐

大文件上传时出现Apache错误500(mod

本文发布于:2023-11-01 13:08:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1549410.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:大文件   错误   上传   Apache   mod

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!