Bỏ qua tới nội dung
Công cụ

Max Upload Size Fixer

Raise the upload limit — and get all three values consistent

Chạy trong trình duyệt của bạn. Không up gì cả.

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.

Về 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

Câu hỏi

Tôi tăng upload_max_filesize mà chẳng có gì thay đổi. Tại sao?

Vì WordPress dùng giá trị NHỎ NHẤT trong ba giá trị: upload_max_filesize, post_max_size và memory_limit. Tăng cái này trong khi cái khác vẫn thấp thì chẳng thay đổi gì. post_max_size phải lớn hơn upload_max_filesize, vì phần thân request mang cả file lẫn form bao quanh nó.

wp-config.php có thể tăng giới hạn upload không?

Chỉ một phần, và điều này làm nhiều người vấp phải. wp-config.php có thể tăng giới hạn bộ nhớ của WordPress, nhưng upload_max_filesize là một chỉ thị PHP mà PHP thường đã đọc xong trước khi WordPress tải. Nếu hosting của bạn khóa các cài đặt PHP, thì có sửa wp-config bao nhiêu cũng không thay đổi được mức giới hạn.

Hosting không cho tôi sửa php.ini. Giờ làm sao?

Thử một file .user.ini trong web root — nhiều shared hosting đọc nó. Nếu cả cách đó cũng thất bại, thì giới hạn được áp đặt ở trên tài khoản bạn và chỉ hosting của bạn mới đổi được. Cứ hỏi họ; thường chỉ là một ticket một dòng.