we have a multisite installation with following configuration:
bash-5.0# cat /usr/local/etc/php/conf.d/uploads.ini
file_uploads = On
memory_limit = 500M
upload_max_filesize = 100M
post_max_size = 100M
max_execution_time = 600
max_file_uploads = 50000
max_execution_time = 5000
max_input_time = 5000
Our /usr/local/etc/php/php.ini
has:
;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;
; Whether to allow HTTP file uploads.
; http://php.net/file-uploads
file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
;upload_tmp_dir =
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M
; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20
but on the wp-admin
panel we see this:
How an we fix this? None of the existing answers helped here. we checked functions.php
file. It does not have any ini_set
calls in it.
Running phpinfo
we have observed:
Loaded Configuration File => /usr/local/etc/php/php.ini
Additional .ini files parsed => /usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini,
...
/usr/local/etc/php/conf.d/uploads.ini
post_max_size => 100M => 100M
upload_max_filesize => 100M => 100M
https://developer.wordpress.org/reference/functions/wp_max_upload_size/
in
function wp_max_upload_size() {
$u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) );
$p_bytes = wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) );
/**
* Filters the maximum upload size allowed in php.ini.
*
* @since 2.5.0
*
* @param int $size Max upload size limit in bytes.
* @param int $u_bytes Maximum upload filesize in bytes.
* @param int $p_bytes Maximum size of POST data in bytes.
*/
return apply_filters( 'upload_size_limit', min( $u_bytes, $p_bytes ), $u_bytes, $p_bytes );
}