跳至內容
工具

最大上傳容量修正工具

提高上傳限制 — 並讓三個數值彼此一致

在你的瀏覽器裡執行。什麼都不會被上傳。

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。那該怎麼辦?

試試在你的網頁根目錄放一個 .user.ini 檔案——許多共享主機會讀取它。如果連這也不行,那這個上限就是在你的帳號之上被強制執行的,只有你的主機商能更改。去問他們吧;這通常只是一張改一行設定的工單。