跳到正文
工具

最大上传大小修复工具

提高上传限制——并让三处数值保持一致

在你的浏览器里运行。什么都不上传。

Target
Where can you edit files?

Hosts differ in what they let you touch. Generate the format you can actually use — and if the first one silently does nothing, that usually means your host overrides it, so try the next.

Resulting upload limit

128 MB

settings

wp-config.php can raise WordPress's own memory limit, but it cannot raise PHP's upload_max_filesize — that is a PHP directive, not a WordPress one. If your host locks PHP settings, no amount of wp-config editing will change the upload cap, and you will have to ask them.

关于最大上传大小修复工具

WordPress 的上传限制由三处必须一致的设置决定:upload_max_filesize、post_max_size 和 memory_limit。设定你的目标大小,本工具就会按正确顺序为 php.ini、.htaccess 和 wp-config.php 生成这三项。

FAQ

常见问题

我调大了 upload_max_filesize,但什么都没变。为什么?

因为 WordPress 取三个值里最小的那个:upload_max_filesize、post_max_size 和 memory_limit。只调大其中一个而另一个还很小,什么都不会变。post_max_size 必须大于 upload_max_filesize,因为请求体里除了文件,还要带上它外面那一圈表单数据。

wp-config.php 能调高上传文件大小限制吗?

只能部分做到,这一点绊倒了很多人。wp-config.php 可以调高 WordPress 的内存限制,但 upload_max_filesize 是一个 PHP 指令,等 WordPress 加载时 PHP 通常已经读完它了。如果你的主机锁定了 PHP 设置,那怎么改 wp-config 都改不了这个上限。

我的主机不让我编辑 php.ini。现在怎么办?

在你的 Web 根目录里试试放一个 .user.ini 文件——很多共享主机会读它。如果这也不行,说明这个限制是在你账户之上强制的,只有主机能改。找他们;这通常就是一张一行字的工单。