Uploading 100KB+ zip files gives an Internal Server Error

两盒软妹~` 提交于 2019-12-07 17:56:57

问题


Here's my HTML code although I think it's irrelevant:

<form enctype="multipart/form-data" action="../developers/submit.php" method="post">
<input name="product_zip" type="file" /><input type="hidden" name="MAX_FILE_SIZE" value="20000">
</form>

The reason I say it's irrelevant is that I can upload zip files under 100kb. I get a 500 internal server error on zip files over 100kb. Everything else works over 100kb, png, gif, newly created zip files, etc.

I've checked all my PHP ini settings. Everything is right including max upload size, execution time, etc.

I'm baffled on this one and can't figure out why my server won't upload certain zip files. It's not my PHP code, because I have completely commented it out and still get a 500.

Server Info:

  • Cpanel / WHM

  • CentOS 5

  • PHP /w mySQL

SOLUTION FOUND: It was a problem with mod_fcgid.

The MaxRequestLen needs to be set higher.

The solution is here: http://pivica.me/blog/500-internal-server-error-while-uploading-files-bigger-then-100kb-modfcgid-problem


回答1:


Problem is the file extension running on hosting server you need to remove the "FastCGI" on some hosts for etc "PHP5.2.x + FASTCGI" change it to "PHP5.2.x" IN file extension manager




回答2:


MAX_FILE_SIZE is just 20kb, try increasing the MAX_FILE_SIZE variable and see if it changes anything




回答3:


It was a problem with mod_fcgid.

The MaxRequestLen needs to be set higher.

The solution is here: http://pivica.me/blog/500-internal-server-error-while-uploading-files-bigger-then-100kb-modfcgid-problem




回答4:


The MAX_FILE_SIZE and MaxRequestLen update should work! HOWEVER, if not go into your "php.ini" configuration folder and update each individual (requires apache reset) as in order in the below list until you can upload the zip file:

  • upload_max_filesize
  • post_max_size
  • max_input_time
  • default_socket_timeout

And if STILL neither work. Try turning on "extension=php_zip.dll" within that same php config file.



来源:https://stackoverflow.com/questions/6970317/uploading-100kb-zip-files-gives-an-internal-server-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!