你需要检查三件事。
upload_max_filesize
, memory_limit
和post_max_size
在php中。ini配置文件。
这三种设置都限制了PHP可以提交和处理的最大数据大小。
典型的post_max_size
和memory_limit
需要大于upload_max_filesize
.
这是WordPress中定义您看到的常量的函数:
File: wp-includes/media.php
2843: /**
2844: * Determines the maximum upload size allowed in php.ini.
2845: *
2846: * @since 2.5.0
2847: *
2848: * @return int Allowed upload size.
2849: */
2850: function wp_max_upload_size() {
2851: $u_bytes = wp_convert_hr_to_bytes( ini_get( \'upload_max_filesize\' ) );
2852: $p_bytes = wp_convert_hr_to_bytes( ini_get( \'post_max_size\' ) );
2853:
2854: /**
2855: * Filters the maximum upload size allowed in php.ini.
2856: *
2857: * @since 2.5.0
2858: *
2859: * @param int $size Max upload size limit in bytes.
2860: * @param int $u_bytes Maximum upload filesize in bytes.
2861: * @param int $p_bytes Maximum size of POST data in bytes.
2862: */
2863: return apply_filters( \'upload_size_limit\', min( $u_bytes, $p_bytes ), $u_bytes, $p_bytes );
2864: }