跳到正文
工具

Max Upload Size Fixer

Raise the upload limit — and get all three values consistent

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

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.

关于Max Upload Size Fixer

WordPress upload limits are set in three places that must agree: upload_max_filesize, post_max_size, and memory_limit. Set your target size and this emits all three, correctly ordered, for php.ini, .htaccess, and 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 文件——很多共享主机会读它。如果这也不行,说明这个限制是在你账户之上强制的,只有主机能改。找他们;这通常就是一张一行字的工单。