无法增加WP内存限制

时间:2017-09-21 17:05:47

标签: php wordpress .htaccess memory-limit

我想将memory_limit增加到512M,但这对我不起作用。我正在使用WampServer。这就是我所做的:

  • .htaccess我在底部添加了php_value memory_limit 512M
  • 位于php.ini的{​​{1}}我D:\wamp\bin\php\php7.0.10
  • 在wp-config.php中,我在底部添加了memory_limit = 512M

但是,插件仍然显示我有40M,因为它建议我至少有128MB。这就是我在define( 'WP_MEMORY_LIMIT', '512M' );

中的含义
defult-constants.php

1 个答案:

答案 0 :(得分:0)

我刚刚找到答案。只需在512M

中输入defult-constants.php即可
    if ( ! defined( 'WP_MEMORY_LIMIT' ) ) {
    if ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) {
        define( 'WP_MEMORY_LIMIT', $current_limit );
    } elseif ( is_multisite() ) {
        define( 'WP_MEMORY_LIMIT', '64M' );
    } else {
        define( 'WP_MEMORY_LIMIT', '40M' );
    }
}

所以现在我有了

    if ( ! defined( 'WP_MEMORY_LIMIT' ) ) {
    if ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) {
        define( 'WP_MEMORY_LIMIT', $current_limit );
    } elseif ( is_multisite() ) {
        define( 'WP_MEMORY_LIMIT', '512M' );
    } else {
        define( 'WP_MEMORY_LIMIT', '512M' );
    }
}
相关问题