I've a site and CMS built on top of Laravel 5.1. The file images larger than 1mb are not being uploaded and gives me Error 500. But when I scale down the same image to 200kb or 400kb, it uploads without any issues. I've also updated the php.ini settings for upload_max_filesize = 70M, post_max_size = 100M and memory_limit = 32M
Asked
Active
Viewed 1,808 times
0
-
What is the error you get with the 500? – Maantje Apr 11 '16 at 08:09
-
please check your server log,to get this error message. – Imtiaz Pabel Apr 11 '16 at 08:10
-
enable error reporting and paste error code `error_reporting(E_ALL);ini_set('display_errors', 'on');` – Mohammad Niknam Apr 11 '16 at 08:13
-
Ok guys, here it is, this is from my error_log file : [11-Apr-2016 07:39:09 UTC] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 11264 bytes) in /home/AAAAA/public_html/vendor/intervention/image/src/Intervention/Image/Gd/Decoder.php on line 34 – Usman Mahmood Apr 11 '16 at 08:40
2 Answers
3
Increase the memory limit to 64 MB or 128 MB from php.ini. I hope it will work for you.
And you can see laravel error at storage/logs/laravel.log.

naf4me
- 403
- 7
- 17
-
Thanks ahossain for your help. I increased this to 128MB and it worked plus I also increased the timeout variables as well. – Usman Mahmood Apr 11 '16 at 08:52
-
@UsmanMahmood if any answer seems right to you then make it as accepted answer. – naf4me Apr 11 '16 at 11:40
0
I had the same problem. I updated memory_limit
, post_max_size
, max_execution_time
etc.. but the problem was still persisting.
This answer resolved my issue: I am having a "The file could not be written to disk." error in ExpressionEngine with files 2MB and up
The issue was that the /tmp mount was only 1MB. Running command df -h will determine the size of your mount.
I had to unmount the /tmp by running command: sudo umount -l /tmp
.
Than remounted it with 16MB by running command: sudo mount -t tmpfs -o size=16485760,mode=1777 overflow /tmp
.

Omar Tanti
- 1,368
- 1
- 14
- 29
-
Link are great but to have a good answer you should write in the post itself what in this link was helpful to solve the problem. Thank you. See [how to write a good answer](https://stackoverflow.com/help/how-to-answer) section about links – Julien Rousé Mar 15 '18 at 11:30