laravel验证大文件上载错误

q5lcpyga  于 2023-01-10  发布在  其他
关注(0)|答案(2)|浏览(124)
{
    "status": false,
    "message": "The member id field is required.",
    "code": 422,
    "errors": {
        "member_id": [
            "The member id field is required."
        ],
        "type": [
            "The type field is required."
        ],
        "filename": [
            "The filename field is required."
        ]
    }
}

i2loujxw

i2loujxw1#

如果您确定错误是由于文件大小,请确保使用正确的数字更新php.ini设置,例如:

post_max_size = 200M
upload_max_filesize = 200M
variables_order = EGPCS
ldioqlga

ldioqlga2#

可能你编辑错了文件,因为php文件夹下有很多php.ini文件,比如cgi,cli,fpm文件夹,你应该把它添加到fpm文件夹下的php.ini文件夹中。
将这些添加到php.ini中

post_max_size = 100M
upload_max_filesize = 100M

然后重新启动nginx服务

sudo systemctl restart nginx.service

相关问题