[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

本文作者:小蚊子
本文链接:[PHP]修改upload_max_filesize无效的问题 - https://djc8.cn/archives/php-modify-upload-max-the-problem-of-invalid-filesize.html
版权声明: 知识共享许可协议本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

标签: 问题, php

添加新评论