小码农 猫的一生在打哈欠中度过

[PHP]修改upload_max_filesize无效的问题

前言

PHP做插件的过程中,发现上传的zip文件,大于8M的会直接中断传输,印象中我已经改过了upload_max_filesize设置为300M了呀。

解决

修改php.ini中的upload_max_filesize为300M后,还要检查下:post_max_size,这玩意儿一般会忘记,也将这个设置为300M后解决问题。

附加配置

file_uploads = On

upload_max_filesize = 300M
post_max_size=300M

max_file_uploads = 20

附加phperror.log

[13-May-2021 09:17:02] NOTICE: fpm is running, pid 1
[13-May-2021 09:17:02] NOTICE: ready to handle connections
NOTICE: PHP message: PHP Warning:  POST Content-Length of 8630132 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
NOTICE: PHP message: PHP Warning:  POST Content-Length of 8630132 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
NOTICE: PHP message: PHP Warning:  POST Content-Length of 8630132 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
NOTICE: PHP message: PHP Warning:  POST Content-Length of 8630132 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
NOTICE: PHP message: PHP Warning:  POST Content-Length of 8630132 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
NOTICE: PHP message: PHP Warning:  POST Content-Length of 8630132 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
[13-May-2021 09:39:11] NOTICE: Finishing ...
[13-May-2021 09:39:11] NOTICE: exiting, bye-bye!
[13-May-2021 09:39:14 UTC] PHP Warning:  Module "redis" is already loaded in Unknown on line 0
[13-May-2021 09:39:14] NOTICE: fpm is running, pid 1
[13-May-2021 09:39:14] NOTICE: ready to handle connections

赏
支付宝赞赏码
支付宝
微信赞赏码
微信
分享 微博 QQ 空间 豆瓣 Twitter

本文最后更新于 2021 年 08 月 17 日,距今日已 1916 天。

签 问题 php

本文出自 小码农,转载请注明出处。

此篇已闭评。

卷首