简体   繁体   English

WordPress-无法增加最大上传大小

[英]WordPress - Increasing max upload size does not work

I have a WordPress Network-Site (with currently one page). 我有一个WordPress网络站点(当前只有一页)。 The big problem is, that the max upload size for media is limited to 1MB inside WordPress. 最大的问题是,在WordPress中,媒体的最大上传大小限制为1MB。

None of my attempts increasing this limit have succeeded. 我提高此限制的尝试均未成功。

What I've tried so far: 到目前为止,我已经尝试过:

  • Increasing the upload_max_filesize AND post_max_size to a value > 1 将upload_max_filesize和post_max_size增加到> 1的值
  • Adding define('WP_MEMORY_LIMIT', '100M'); 添加define('WP_MEMORY_LIMIT','100M'); to wp-config.php 到wp-config.php
  • Adding a rules to my .htaccess to overwrite the initial php.ini settings 向我的.htaccess添加规则以覆盖初始php.ini设置
  • Adding php directives to overwrite initial php.ini settings 添加php指令以覆盖初始php.ini设置
  • Applying apply_filters ( 'upload_size_limit', 50000, 50000, 50000 ) to my functions.php manually 手动将apply_filters('upload_size_limit',50000,50000,50000)应用于我的functions.php

The server reloads the php.ini automatically within a specific time period. 服务器在特定时间段内自动重新加载php.ini。 By running phpinfo(), php confirms that change. 通过运行phpinfo(),php确认该更改。

A WordPress Plugin (Revo Slider) has a builtin upload-size-check and it detects the change, too. WordPress插件(Revo Slider)具有内置的upload-size-check,它也可以检测到更改。

A look in wp-includes/media.php says: 在wp-includes / media.php中查看说:

    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' ) );

    /**
     * Filter 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 );
}

Any ideas on that? 有什么想法吗?

Okay, I've found the answer myself: 好的,我自己找到了答案:

When installing a WordPress Multisite instance, you have to manually increase the max. 安装WordPress Multisite实例时,您必须手动增加最大值。 upload size on the Network-Settings page ... 在“网络设置”页面上上传大小...

If you have installed WP Multisite Go to Network Admin -> settings page, 如果已安装WP Multisite,请转到“网络管理->设置”页面,

Specify Max upload file size in Kb (12000Kb = 12MB) 指定最大上传文件大小(KB)(12000Kb = 12MB)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM