尝试在本地运行 Wordpress 站点时出现内存限制问题
我正在开发一个 WordPress 网站,并尝试建立一个本地测试环境以用于开发目的。我正在运行 MAMP(Mac Apache MySQL PHP)堆栈。
我遇到以下错误:
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
我尝试通过修改 wp-config.php 中的第 28 行来增加内存限制:
define('WP_MEMORY_LIMIT', '2024MB');
并通过在 index.php 中包含以下值,但
ini_set('memory_limit','64M');
对于我尝试过的任何内存值都没有任何运气。我对 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许 MAMP 配置不允许您以编程方式覆盖内存限制。按照描述在 php.ini 中设置 这里。
Perhaps the MAMP configuration doesn't allow you to override the memory limit programmatically. Set it in php.ini as described here.