首页 > Wordpress > 解决:Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate xxx bytes)

解决:Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate xxx bytes)

2009年6月12日 Galaxy 发表评论 阅读评论

http://wordpress.org/support/topic/194370

Here’s the full solution in the cleanest possible way:

  1. Create a file called php.ini in the root of your site (if you are using a hosted addon domain, this must be in the subdirectory of that site)
  2. In php.ini, enter a line that says
    memory_limit = 64MB
  3. In your site’s .htaccess (being a Wordpress blog, I’m assuming there is one), enter the following line
    SetEnv PHPRC /<unix path to the directory where php.ini is>/
    (keep the slashes)
  4. Edit wp-config.php and enter the following line
    define('WP_MEMORY_LIMIT', '64M');
  5. Upload the new files to the server

Oh, and don’t tell your hosting provider you’ve done this…


这次升级2.8后,就要在wp-config.php中加define ('WP_MEMORY_LIMIT', '64M');了……

Tags: ,

Related posts

分类: Wordpress 标签: , 1,438 views
1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 5.00 out of 5)
Loading ... Loading ...
  1. Galaxy
    2009年6月12日03:10 | #1

    Oops, I’ve checked my other sites after fixing the one with the problem and this solution killed them. However, I’ve removed the php.ini and the line in .htaccess and left only the line in wp-config.php and things are working OK.


    嘛,还是应该悠着点,吗……

    [回复]

  2. Galaxy
    2009年8月8日18:40 | #2

    惊见此文被访问次数增加,自己上g.cn看了下,排行第6。恩,甚喜。

    估计是许多人把WP自动升级到2.8发现了这错误。

    目前如果不是虚拟主机的话,想改大设置基本就这种方法了,有种“酒香不怕巷子深”的感觉。
    (再陶醉几秒吧……

    [回复]

  3. 2009年12月17日16:29 | #3

    还有其他办法吗? 这种办法好象不行!

    [回复]

    Galaxy 回复:
    | 编辑

    3个地方都改了吗?
    用phpprobe测下,如果没变,估计要么不是Apache,要么是被禁用了。

    [回复]

  1. 本文目前尚无任何 trackbacks 和 pingbacks.

Locations of visitors to this page