wordpress内存限制WP MEMORY LIMIT设置

发布于 2022-03-13 当前分类:» 学习笔记 阅读数:448
1519630892121267

建议设置内存至少128MB,如果要导入经典的演示数据,内存要求256MB , 请定义wp-config.php文件内存限制

我修改过php.ini 也修改过wp-config.php 跟.htaccess试了很多方法也花了很长时间都是以失败告终。

后来修改

/wp-includes/default-constants.php

15行左右找到

<pre name="code" class="html">functionwp_initial_constants( ) {  
    global$blog_id;  
    
    // set memory limits  
    if( !defined('WP_MEMORY_LIMIT') ) {  
        if( is_multisite() ) {  
            define('WP_MEMORY_LIMIT','128M');  
        }else{  
            define('WP_MEMORY_LIMIT','64M');  
        }  
    }  
    
    if( ! defined('WP_MAX_MEMORY_LIMIT') ) {  
        define('WP_MAX_MEMORY_LIMIT','256M');  
    }

修改为

functionwp_initial_constants( ) {  
    global$blog_id;  
    
    // set memory limits  
    if( !defined('WP_MEMORY_LIMIT') ) {  
        if( is_multisite() ) {  
            define('WP_MEMORY_LIMIT','256M');  
        }else{  
            define('WP_MEMORY_LIMIT','256M');  
        }  
    }  
    
    if( ! defined('WP_MAX_MEMORY_LIMIT') ) {  
        define('WP_MAX_MEMORY_LIMIT','256M');  
    }

刷新网页成功解决

1519631029420248


发布评论


Warning: error_log(C:\wwwroot\16km.net\wp-content\plugins\spider-analyser/#log/log-0819.txt): failed to open stream: No such file or directory in C:\wwwroot\16km.net\wp-content\plugins\spider-analyser\spider.class.php on line 2900