我有一个网站和CMS构建在Laravel 5.1之上。大于1mb的文件图像没有上传,并给我错误500。但当我将同一张图片缩小到200kb或400kb时,它上传起来没有任何问题。我还更新了的php.ini设置upload_max_filesize=70M,post_max_size=100M,memory_limit=32M
从php.ini将内存限制增加到64MB或128MB。我希望它能为您工作。
您可以在storage/logs/laravel.log中看到laravel错误。
我也遇到了同样的问题。我更新了memory_limit
、post_max_size
、max_execution_time
等。但问题仍然存在。
这个答案解决了我的问题:;无法将文件写入磁盘"ExpressionEngine中的错误,文件为2MB及以上
问题是/tmp装载只有1MB。运行命令df-h将确定装载的大小。
我不得不通过运行命令sudo umount -l /tmp
来卸载/tmp。
然后通过运行命令sudo mount -t tmpfs -o size=16485760,mode=1777 overflow /tmp
以16MB重新安装它。