简体   繁体   中英

Laravel + AJAX file upload fails due to file size

Uploading files larger than around 100KB fails with 500 server error. The site is built on Laravel and is using AJAX for file uploading. Small files can be loaded without problems.

I have tested uploading with the same image that is scaled with GIMP to smaller than 100KB and another one which is scaled bigger than 100KB, so the problem cannot be file type or anything related to image itself instead the problem seems to be related only to file size.

I have checked php.ini for max memory, upload_max_filesize, post_max_size and all are fine. I have also checked that apache virtualhost is not having max file size configuration. I have checked apache logs and it shows only 500 server error without anymore details. I cannot find any clue in any other log file. I have debugged the jQuery to AJAX call and ensured that the called function on PHP side is not being called. I have tried to check Laravel configurations, but couldn't find anything that could be related.

Any ideas where the file size limit could be coming from? Or any ideas where to get more information where the 500 is coming from?

原因是apache mod_fcgid默认将文件上传大小限制为128KB。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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