有朋友安装插件出现 WordPress错误:Fatal error: Allowed memory size of XX bytes exhausted…,具体代码类似:

Source code    
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes) in
 /home/user/public_html/xxxxxx.php on line xxx

错误根源

这其实是WordPress程序、插件和主题等消耗的内存超过了WordPress原本限制的内存,WordPress官方对这个问题有专门说明以及解决办法:http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP

解决办法

网上对于该问题的解决办法有如下3种,大家不妨一一测试:

方法一:

在 wp-config.php 文件的 define (‘WPLANG’, ”);下一行添上:

1
define('WP_MEMORY_LIMIT', '64M');

方法二:

在WordPress的安装目录下新建一个.htaccess文件(已存在就不用新建了),在文件内填上:

1
php_value memory_limit 64M

方法三:

如果你有修改 php.in 文件的权限,可以查找 memory_limit 修改为

1
memory_limit = 64M ;
分享到: 更多

说点什么

avatar
  Subscribe  
提醒