尝试在本地运行Wordpress站点时内存限制问题

问题描述:

I'm working on a wordpress website and I'm attempting to set up a local test-environment for development purposes. I'm running the MAMP (Mac Apache MySQL PHP) stack.

I'm running into the following error:

Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 4864 bytes) in /Users/casey/Documents/workspaces/yofreesamples.com/wp-includes/functions.php on line 1174

I've attempted to increase the memory limit by modifying line 28 in wp-config.php:

define('WP_MEMORY_LIMIT', '2024MB');

and by including the following value in index.php

ini_set('memory_limit','64M');

without any luck for any memory values I've tried. I'm relatively new to wordpress, anyone have any idea what's going on?

我正在使用wordpress网站,我正在尝试为开发目的设置本地测试环境 。 我正在运行MAMP(Mac Apache MySQL PHP)堆栈。 p>

我遇到以下错误: p>

 致命错误 :允许的内存大小262144字节耗尽(试图分配4864字节)在/Users/casey/Documents/workspaces/yofreesamples.com/wp-includes/functions.php第1174行
  code>  pre> \  n 
 

我试图通过修改wp-config.php中的第28行来增加内存限制: p>

  define('WP_MEMORY_LIMIT','2024MB')  ; 
  code>  pre> 
 
 

并在index.php中包含以下值 p>

  ini_set('memory_limit','64M  '); 
  code>  pre> 
 
 

没有运气,我尝试过的任何内存值。 我对wordpress比较陌生,任何人都知道发生了什么事? p> div>

Perhaps the MAMP configuration doesn't allow you to override the memory limit programmatically. Set it in php.ini as described here.