Fix wordpress fatal error allowed memory size exhausted
Posted by Daniel at 2:24 am
Fatal error: Allowed memory size of …… bytes exhausted (tried to allocate …. bytes) in home/of/some/thing/fishy.php
I experienced this weird WordPress or rather PHP error last night when trying to view my blog when i got home, at first i thought that there was a technical problem at my server so i waited, then i waited and waited and waited again for almost 7 hours then i cant wait no more i want to blogggg… so i contact my hosting provider and they told me that there is nothing wrong with the server nahhh WTF! i told to my self. .
but i cant figure out the problem at first. .then i figure out that i can access other part of my site. .so i said to myself.. hmm maybe its because of the plugin that i last installed so again i waited and let the night past but the error was still there when i woke up. .did you know what did i do? haha call me dumb coz i dont know what to do so i decided to delete my blog files and install wordpress again but ofcourse i backed up my database so i can restore. . but the problem is still there nahh WTF again i said to my self. . haha
until i found a bit of code that can save my life sana haha
hhyeahh: . . PHP Memory Allocation Error was the real problem it is an error returned by php when it used up the default memory limit, it occurs when PHP is handling or processing a large amount of data or records more that its default memory allocation. I found to 3 ways to Fix this problem
1st: Increase the memory limit of an individual PHP file
ini_set(”memory_limit”,”16M”);
Put this code at the top of every PHP file that errors are showing, you can expand the memory by changing the 16M to a other value if your still getting errors,. you can set it to 16M, 18M etc..
2nd: edit your PHP.INI file – this option will apply to all the php files in your site
search your php.ini file and find memory_limit: put values like at the top for example
memory_limit: 16M
3rd: use .htaccess to expand the memory allocation – this option will apply to all the php files in your site
php_value memory_limit 32000000
Copy and paste the code above to your .htaccess file
Thats it! the errors are gone
Nice! :happy: Niligtas mo buhay ko! :lol2:
Nabigla nalang talaga ako kahapon nang biglang naglabasan ang mga walang kwentang error message na fatal error: blah blah blah… :shocked:
Tsk, tsk… Pero nalilito pa rin ako. Kasi, sa isang blog ko, pag-ina-access ko pa lang ang site, andun na agad ‘yung error. Sa kabila naman, lumalabas lang kapag nag-la-login ako. Tapos nag-install ako ng bago para malaman kung ano ba talaga. Ok naman kaya tuluyan talaga akong nagtaka kung anong problema ‘dun sa dalawa, hanggang sa nakarating ako sa post na ‘to. Bakit kaya bigla nalang sumusulpot ang error na ‘to at bakit hindi consistent? Wala na ba talagang pagkakataon na maibalik sa dati ang isang WordPress blog na nagkaroon ng ganitong error maliban nalang kung gagamitan ng isa sa tatlong solusyon na ‘yan? (‘Yung ikatatlo pala ‘yung ginamit ko.) Meron ba talagang php.ini na file? Di ko kasi makita e. At wala kayang side-effect ang paglalagay ng dagdag linyang ‘yan sa .htaccess?
Hala, pasensya na. Sobrang na-overwhelm ata ako kaya napuno ng tanong. Muli, maraming salamat!
Nelson’s last blog post..Virus from Surigao