最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

uploads - Wordpress shows different upload_max_filesize than php.ini setting

programmeradmin1浏览0评论

I have php.ini files in the following directories of my WordPress installation:

  • /wp-admin
  • /wp-content
  • / (where there wp-config.php lies)

In all of them I set upload_max_filesize = 640M; - 640MB is the maximum value that is allowed by my provider in my package (I called).

memory_limit = 268435456;
post_max_size = 67108864;
upload_max_filesize = 640M;

I did NOT configure an upload_max_filesize in wp-config.php or in .htaccess. I confirmed this value with phpinfo() and with ini_get('upload_max_filesize').

Nonetheless, WordPress displayes 64 MB as maximum on the media upload page and on the WooCommerce status page.

I am utterly puzzled. I checked every post on stack but I couldn't find an answer to that dissonance. Help would be much appreciated.

I have php.ini files in the following directories of my WordPress installation:

  • /wp-admin
  • /wp-content
  • / (where there wp-config.php lies)

In all of them I set upload_max_filesize = 640M; - 640MB is the maximum value that is allowed by my provider in my package (I called).

memory_limit = 268435456;
post_max_size = 67108864;
upload_max_filesize = 640M;

I did NOT configure an upload_max_filesize in wp-config.php or in .htaccess. I confirmed this value with phpinfo() and with ini_get('upload_max_filesize').

Nonetheless, WordPress displayes 64 MB as maximum on the media upload page and on the WooCommerce status page.

I am utterly puzzled. I checked every post on stack but I couldn't find an answer to that dissonance. Help would be much appreciated.

Share Improve this question asked May 3, 2020 at 12:25 jasiejasie 1531 silver badge14 bronze badges 0
Add a comment  | 

2 Answers 2

Reset to default 1

UPDATED:

I figured out the following by playing with the numbers in the php.ini in /wp-admin:

The add upload page in the admin area seems to always display the lower value of either post_max_size and upload_max_filesize.

In my case, post_max_size was lower than upload_max_filesize which is the reason for "Maximum size of files for uploads" not displaying the 640MB but 64MB.

I suppose this has to do with this: see php docs as:

post_max_size integer
Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. Generally speaking, memory_limit should be larger than post_max_size.

upload_max_filesize for uploading file from multipart-form. Other hand post_max_size is posted size from form. (input textarea etc). So i prefer, create php file in root directory such as php.php and write phpinfo for real compare.

<?php
phpinfo();
发布评论

评论列表(0)

  1. 暂无评论