[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,服務器上放置的用戶數量。
如果您對這篇文章有看法或者有不同見解,歡迎在米粒在線本篇文章評論探討。
2F
/**這一行是定義WP的默認限制內存為1GB,如果以后再出現內存用盡 只需改大這里的值即可*/
define(‘WP_MEMORY_LIMIT’, ‘3072M’);
1F
沒用啊!
B1
@ neihi @neihi : 這是個人經驗,勿要動怒。本站用的是西數的主機。你自己多嘗試下,可能wp版本不一樣或者主機不同,更改的也不同。你可以問問你的主機商,他們會給你建議。