解决WordPress 内存限制问题

在使用WordPress 3.0+版本过程中同样会遇到2.0版WordPress Memory Limit 内存限制问题:Fatal error: Allowed memory size of 33554432 bytes exhausted.但是解决方法已经不是像2.0版那样修改wp-settings.php文件,而是修改/wordpress/wp- includes/default-constants.php文件。

将原文件如下内容:

function wp_initial_constants( ) {
	global $blog_id;

	// set memory limits
	if ( !defined('WP_MEMORY_LIMIT') ) {
		if( is_multisite() ) {
			define('WP_MEMORY_LIMIT', '64M');
		} else {
			define('WP_MEMORY_LIMIT', '32M');
		}
	}

修改为:

function wp_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');
		}
	}

保存该文件并刷新,问题解决.

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注