wordpress Fatal error: Allowed memory size of X bytes exhausted

技术百科 码拜 11年前 (2013-05-15) 1540次浏览 0个评论

安装W3 Total Cache插件后,无法进入后台界面,wordpress出现Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate xxx bytes) in xxx.php on line xxx。前台访问正常。

联系客服支持,问题解决方法如下:

wordpress前台或后台出现Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate xxx bytes) in xxx.php on line xxx的解决办法 打开wp-includes目录下default-constants.php文件,找到如下代码

// set memory limits if ( !defined(‘WP_MEMORY_LIMIT’) )

{ if( is_multisite() ) { define(‘WP_MEMORY_LIMIT’, ’64M’); }

else { define(‘WP_MEMORY_LIMIT’, ’32M’); } }

if ( ! defined( ‘WP_MAX_MEMORY_LIMIT’ ) )

{ define( ‘WP_MAX_MEMORY_LIMIT’, ’256M’ ); }

然后把define(‘WP_MEMORY_LIMIT’, ’32M’);这个32M修改为64M,保存,覆盖原来的文件,修改后如下图:

wordpress Fatal error: Allowed memory size of  X bytes exhausted

如果还是不行,可以修改成96M、128M或更大。
注意:请不要使用Windows系统自带的记事本修改代码,推荐使用Notepad++、UltraEdit、EditPlus等编辑器修改,cPanel用户可以直接在cPanel文件管理器Edit。否则可能会出现乱码符号


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明wordpress Fatal error: Allowed memory size of X bytes exhausted
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!