wordpress网站内存耗尽–解决办法[resolved] Fatal error: Allowed memory size of 134217728 bytes exhausted (6 posts)

  • 3
  • 11,101 views

[resolved] Fatal error: Allowed memory size of 134217728 bytes exhausted (6 posts)

(翻译内容:【解析】致命错误:134217728字节用尽宠物内存大小(6个职位))

本篇文章翻译来自谷歌,仅供参考解决问题。欢迎到访米粒在线。

更多内容参考百科知道!更有相关文章wordpress网站Fatal error: Allowed memory size of 134217728 bytes exhausted…  但是解决办法貌似下面此篇文章谈到的才有效果。大家自行测试,欢迎留言探讨。

问题内容:

getting this error on website:
http://frenchgardenrestaurant.com/

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20 bytes) in /nfs/www/WWW_pages/sorrel/frenchgardenrestaurant.com/wp-content/themes/genesis/lib/widgets/enews-widget.php on line 39

Client was just editing pages yesterday and claims they did not add any plugins or upgrade anything.

Does anyone have any idea as to what the problem is? Thanks so much in advance!

问题内容翻译参考:

在网站上得到这个错误:http://frenchgardenrestaurant.com/

致命错误:134217728字节用尽宠物内存大小(试图分配20字节)在第39行

客户端只是编辑的网页昨天声称,他们没有添加任何插件或升级任何东西。

没有任何人有任何想法,问题是什么?非常感谢在前进!

解决办法:

Using FTP you can try increasing the memory for PHP and WordPress in several different ways:

1) You can edit the memory_limit line in your php.ini (if you have access to that file) to increase memory to 64M:

memory_limit = 64M;

2) If you can't get to the php.ini file, add this line at the top of your .htaccess file:

php_value memory_limit 64M

If that doesn't work or throws a "500 Internal Server Error", delete the line from .htaccess.

3) Try adding the line below near the top of your wp-config.php file, a few lines of white space below the opening <?php

define('WP_MEMORY_LIMIT', '64M');

If none of those work, your host probably doesn't allow memory allocation overrides. You're stuck with what they give.

You can run phpinfo to see what kind of memory allocation you already have. Make a plain text file and call it phpinfo.php and put just this line in it:

<?php phpinfo(); ?>

then put the file in the root of your server, and then go to that file with your web browser. You'l see all the php info you need; scroll down for memory settings. If you get an error, that means your web hosting company won't allow phpinfo to run for security reasons.

解决办法翻译参考:

使用FTP,您可以尝试增加在几种不同的方式为PHP和WordPress的内存:

1)您可以编辑你的php.ini中的memory_limit的行(如果你有机会到该文件),以增加内存为64M:

的memory_limit = 64M;

2)如果你不能去php.ini文件,在你的htaccess文件的顶部添加下面一行:

php_value memory_limit的64M

如果不工作,或抛出一个“500内部服务器错误”,从。htaccess文件删除就行了。

3)尝试添加下面的行靠近你的wp-config.php文件的顶部,开口下方的几行空白 <?PHP

DEFINE('WP_MEMORY_LIMIT','64M');

如果没有这些工作,你的主人可能不会让内存分配覆盖。你坚持什么,他们给的。

您可以运行phpinfo,看看有什么样的内存分配你已经有了。做一个纯文本文件,并调用它的phpinfo.php,并把眼前这个行吧:

?<PHP的phpinfo(); ?>

然后将文件放在服务器的根目录,然后进入该文件与Web浏览器。You'l看到所有你需要的PHP信息; 向下滚动的内存设置。如果你得到一个错误,这意味着你的网络托管公司不会允许的phpinfo运行出于安全原因。

解决办法验证回应:

Thank you for quick response. I don't have access to php.ini file. I tried step 2 (editing .htaccess) no effect, tried step 3 (editing wp-config.php) no effect.

I created the phpinfo.php file and got all of the info:
http://frenchgardenrestaurant.com/phpinfo.php

looks like memory limit is set to 128m

Hmmm... any other thoughts on what the issue could be?

Thanks again!

解决办法验证回应翻译内容:

谢谢你的快速反应。我没有访问php.ini文件。我试过第2步(编辑。htaccess的)没有影响,尝试第3步(编辑WP-config.php文件)没有影响。

我创建了phpinfo.php的文件,并得到了所有的信息:http://frenchgardenrestaurant.com/phpinfo.php

貌似内存限制设置为128M

嗯......什么问题可以是任何其他的想法?

再次感谢!

根据以上的相关技术解答,我们知道修改wp-config.php文件即可解决。

只需加入一段代码define('WP_MEMORY_LIMIT', '64M'); 即可。

至于为什么是64M这看你了,也可以是128M或者更大。

以下文章和上面的也是相同的解决办法,仅供参考。


 

WordPress:致命错误:允许的内存大小41943040字节用尽解决方法(内存用尽)

意外,很意外。今天打开我的博客就提示一行内存用尽的代码。后台更是无法打开,几经周折。网上很多的方法都试过了,觉得可行的最后。是下面这条,大多空间也都可以。

错误提示:Fatal error: Allowed memory size of 8388608 bytes exhausted.
或者PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 6233929 bytes) in /home/…/press/wp-includes/cache.php on line 330
还有类似:Allowed memory size of 33554432 bytes exhausted (tried to allocate 368640 bytes) in /wordpress/wp-includes/class-simplepie.php on line 9575

在你的WP-config.php文件里面添加一行代码:

/**这一行是定义WP的默认限制内存为1GB,如果以后再出现内存用尽 只需改大这里的值即可*/
define('WP_MEMORY_LIMIT', '1024M');

当然,这个 文件在你的WordPress安装的根目录。修改后即可访问了。如果以上方法不行,建议你咨询你的空间商(部分小白:卖空间给你的那个人)。


WordPress内存耗尽错误,解决办法

WordPress程序消耗内存,插件,主题也都消耗内存,在WordPress新版本(WordPress 3.0+)使用中会消耗更多的内存,PHP程序在执行过程中没有足够的内存,你的网站就可能出现这样的错误:

这种问题虽然在WordPress新版本中频发出现,但这并不是WordPress的BUG,问题的严重性,使得WordPress官方对这个问题都有专门说明以及解决办法:http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP

回到之前的错误,在错误信息中,有两个关键的点,67108864 bytes和1203208 bytes,换算到M就是64M和1.1M,每次执行PHP需要分配1.1M的内存,但是由于整体消耗内存量太大,默认64M的最大内存不够用,被耗尽了,根据WordPress官方给出的解决办法,我们只要在wp-config.php中加入如下代码:

/**这一行是定义WP的默认限制内存为1GB,如果以后再出现内存用尽 只需改大这里的值即可*/
define('WP_MEMORY_LIMIT', '1024M');

至于为什么是1024M,这个就看你个人了,当然超过都是可以的。

以上的基础是,服务器本身的硬件不错,然后看两点:1,服务器的配置与性能优化;2,服务器上放置的用户数量。

如果您对这篇文章有看法或者有不同见解,欢迎在米粒在线本篇文章评论探讨。

米粒在线
  • 本文由 发表于 2014年6月14日13:53:21
  • 转载请务必保留本文链接:https://www.miliol.org/24339.html
生活道理

熬夜如何改变了我们的身体

熬夜的危害有很多,如:经常感到疲劳,免疫力下降:人经常熬夜造成的后遗症,最严重的就是疲劳、精神不振;人体的免疫力也会跟着下降,感冒、胃肠感染、过敏等等自律神经失调症状都会出现。 头痛:熬夜的隔天,上班...
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

评论:3   其中:访客  3   博主  0
    • 米粒在线 米粒在线

      /**这一行是定义WP的默认限制内存为1GB,如果以后再出现内存用尽 只需改大这里的值即可*/
      define(‘WP_MEMORY_LIMIT’, ‘3072M’);

      • neihi neihi 0

        没用啊! :twisted:

          • 米粒在线 米粒在线

            @ neihi @neihi : 这是个人经验,勿要动怒。本站用的是西数的主机。你自己多尝试下,可能wp版本不一样或者主机不同,更改的也不同。你可以问问你的主机商,他们会给你建议。