我在 AWS EB 上部署了我的 Laravel 应用程序并将其与 Cloudflare 链接!
当我上传大小为 4MB 的图片时,出现此错误:
The Image failed to upload.
在本地,它有效,但在服务器上,出现错误!
我使用 S3 上传文件:
我要上传的代码:
$data = $request->all():
if ($image = $request->file('image')) {
Storage::disk('s3')->put('uploads/users/',$image,'public');
$data['image'] = $image->hashName();
}
User::create($data);
小于 2MB 的上传工作正常!
我像这样在 php.ini
中放置零钱:
创建这个目录:
.platform/files/php.ini
post_max_size = 2G
upload_max_filesize = 2G
还是一样的错误!