简体   繁体   English

KCFinder上传文件大小限制

[英]KCFinder upload file size limit

In my php.ini i verified that upload limit is 20M 在我的php.ini中,我确认上传限制为20M

However, when i try to upload files it accepts everything under approximately 120kb and refuses everything above that. 但是,当我尝试上传文件时,它会接受大约120kb以下的所有内容,并拒绝高于该值的所有内容。

I didn't make any specific changes on kcfinder. 我没有对kcfinder进行任何特定的更改。

If it is important, i use Firefox and Chrome. 如果重要的话,我使用Firefox和Chrome。

Any idea what can be problem? 知道会是什么问题吗?

file uploads are affected with more variables than upload_max_filesize alone. 文件上传受变量影响的程度比单独的upload_max_filesize更大。 File upload is just POST request, so you need to check post_max_size too and adjust it if needed. 文件上传只是POST请求,因此您也需要检查post_max_size并根据需要进行调整。 In general you want post_max_size to be at least the size upload_max_filesize + some overhead for other POST data. 通常,您希望post_max_size至少为upload_max_filesize大小+其他POST数据的开销。

Ok, here is the solution, but first, what did i try and got while i was exploring the issue: 好的,这是解决方案,但是首先,我在探索问题时尝试了什么:

  • in php.ini everything seemed ok 在php.ini中,一切似乎都还可以
  • I noticed that i cant upload files larger than certain size, approximately ~127 kb 我注意到我无法上传大于特定大小(约〜127 kb)的文件
  • Through the browser i could not understand easily what was wrong so in my case first that i noticed that it had to be something on server side. 通过浏览器,我不容易理解出了什么问题,因此在我的情况下,我首先注意到它一定是服务器端的东西。
  • In my case i'm using ispCP control panel (not very happy with it) and ispCP have certain default error 400, 401.html, 403.html, 404.html, 500.html, 503.html pages that even have some stupid JS "" with "get_path()" function, which was reported as "the one causing the problem" via browser (FireBug). 以我为例,我使用的是ispCP控制面板(对此不太满意),并且ispCP具有某些默认错误400、401.html,403.html,404.html,500.html,503.html甚至有些愚蠢的页面带有“ get_path()”功能的JS“”,通过浏览器(FireBug)报告为“导致问题的人”。 Since i was confused for few hours, i removed all those error pages and than i noticed that i have another "error" in (FireBug). 由于我困惑了几个小时,所以我删除了所有这些错误页面,然后我注意到(FireBug)中还有另一个“错误”。 But this time i was able to notice it is Server side error 500 但是这次我能够注意到这是服务器端错误500
  • I immediately understood that i need to look into /var/log/apache2/... error log files. 我立即明白,我需要查看/ var / log / apache2 / ...错误日志文件。
  • message there was: [Wed Sep 12 05:05:47] [warn] [client 12 05:05:47] mod_fcgid: HTTP request length 135279 (so far) exceeds MaxRequestLen (131072), referer: http://url--to--script.php?type=images&dir= 消息有:[Wed Sep 12 05:05:47] [warn] [client 12 05:05:47] mod_fcgid:HTTP请求长度135279(到目前为止)超过了MaxRequestLen(131072),引用网址:http:// url- -to--script.php?type = images&dir =
  • so i "$ apache2ctl -M" and i found that module on the list "fcgid_module (shared)" 所以我“ $ apache2ctl -M”,我发现该模块在列表“ fcgid_module(共享)”上
  • in case someone is not familiar with apache modules, usually config files for apache modules are located here: "/etc/apache2/mods-available/..." mine one as you saw was "fcgid.conf" (there is also corresponding "*.load" file for every module). 如果有人不熟悉apache模块,通常会在这里找到apache模块的配置文件:“ / etc / apache2 / mods-available / ...”我看到的是“ fcgid.conf”(也有对应的每个模块的“ * .load”文件)。
  • So i added two config lines there: 所以我在那儿添加了两条配置行:

    FcgidMaxRequestLen 52428800 FcgidMaxRequestLen 52428800

    MaxRequestLen 52428800 MaxRequestLen 52428800

/etc/init.d/apache2 restart AND IT WORKED :D /etc/init.d/apache2重新启动并完成:D

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM