解决:Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate xxx bytes)
http://wordpress.org/support/topic/194370
Here’s the full solution in the cleanest possible way:
- 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)
- In php.ini, enter a line that says
memory_limit = 64MB - 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) - Edit wp-config.php and enter the following line
define('WP_MEMORY_LIMIT', '64M'); - 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: Wordpress, ZT
MoeFan (萌番)
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.
嘛,还是应该悠着点,吗……
[回复]
惊见此文被访问次数增加,自己上g.cn看了下,排行第6。恩,甚喜。
估计是许多人把WP自动升级到2.8发现了这错误。
目前如果不是虚拟主机的话,想改大设置基本就这种方法了,有种“酒香不怕巷子深”的感觉。
(再陶醉几秒吧……
[回复]
还有其他办法吗? 这种办法好象不行!
[回复]
Galaxy 回复:
十二月 20th, 2009 at 8:19 下午 | 编辑
3个地方都改了吗?
用phpprobe测下,如果没变,估计要么不是Apache,要么是被禁用了。
[回复]