Hey, Would you like to work at Home ?? Just click here No need to pay, just register free and activate your account and get data Entry Work at your Home.

Wednesday, September 2, 2009

PHP Fatal error : Out of memory Problem

PHP Fatal error: Out of memoryProblem. Let see how to solve this problem using various techniques.


The first thing I could think of was to restart the Apache httpd service. This immediately solved the issue. but I knew this is not a permanent fix for the issue. When I researched further, I got to know that the
error comes when certain PHP scripts require more memory than PHP was allowed by default.


So the solution is to increase the memory allocated for

PHP. How to do that? There are 4 possible ways -


1. Try looking for the php.ini file. You might find some redundant php.ini files, so make sure you have got the one which is actually being read by PHP. o be sure, create a new php file in your root folder, say “check.php” and have phpInfo(); within the php open and close tags. Execute this file to get the information on where the php.ini is residing. Normally it will be in /usr/local/lib/php.ini


Open the php.ini file in a text editor like TextPad (not in Notepad) and change the values for memory_limit. By default you should see memory_limit = 8M. Try changing it to 12M. If it doesn’t work, increase it to 16M or even 24M and so on.


2. In case you can’t find the php.ini file or do not have access to it, then open up the file which was throwing the error (test.php in my case) and add a line below just after ini_set(’memory_limit’, lsquo;12M’);


3. You can even consider adding a line in .htaccess file which will resolve the issue.
php_value memory_limit 32M


4. Or else, Try adding this line to your wp-config.php file:

Increasing memory allocated to PHP
define('WP_MEMORY_LIMIT', '32M');


If none of the above things solve your issue, then talk to you host.


Note: I am now worrying on which PHP script required an increase in memory allocation. The analysis won’t be so easy though.

27 comments:

phpprobid customisation said...

Its highly informative. I would be visiting your blog hereafter regularly to gather valuable information.

web development company said...

Great post and very well written, that will really help you to learn Web Design, web development and SEO Strategies to help businesses web design company . You can find out many useful information about web design, seo and his work by visiting his blog and I Just wanna say thanks you for the information you have shared. Web Design Company India

cheapcallstophone said...

Thanks for sharing very nice post
Web Design Company India

Web Developers Chennai said...

We are also one of the Leading Web Design Company in Chennai,our services are web design,web hosting,seo chennai,email marketing,website design,logo design,maintenance etc.please add my website to your blogger.it is very useful for us.

Price Trades said...

Man I like your post and it is so good and I am definetly going to save it. One thing to say the Indepth analysis this article has is trully remarkable.No one goes that extra mile these days? Bravo!! Just one more tip you canget a Translator for your Worldwide Audience !!!

Price Trades

Designer Jeans said...

Thanks for taking this opportunity to discuss this, I feel fervently about this and I like learning about this subject.

Unknown said...

Thank you for such a wonderful post. I enjoyed every bit of it.how to make soap at home

Home Decor said...

Very happy to see your article, I very much to like and agree with your point of view. Thank you for sharing.

Uk Ties said...

Man I like your post and it is so good and I am definetly going to save it. One thing to say the Indepth analysis this article has is trully remarkable.No one goes that extra mile these days? Bravo!! Just one more tip you canget a Translator for your Worldwide Audience !!!

strumpfhosen said...

This Blog is going places, the people, the layout, amazing to see such dedication and focus.

SEO Los Angeles said...

This is a good common sense article. Very helpful to one who is just finding the resources about this part. It will certainly help educate me.

Oximeter for sale said...

Wow, this is the best site I’ve ever read. Thank you for sharing this.

Oximeter said...

It is so lucky to read your blog,it is full of useful message.I wish we both can do better in the future.
It great honour if you can visit our website,and give us some suggession.

Thermage chicago said...

Thank you, thats very interesting information. I need to share with my friends.

Cheap penny auctions sites said...

Another informative blog… Thank you for sharing it… Best of luck for further endeavor too.

Pantyhose said...

Interesting and important information. It is really beneficial for us. Thanks

SEO Services said...

Simply want to say your article is as surprising. The clearness in your post is simply great and i can assume you are an expert on this subject. Fine with your permission let me to grab your RSS feed to keep up to date with forthcoming post. Thanks a million and please continue the rewarding work.

Wholesale perfume said...

Thanks for ones marvelous posting! I seriously enjoyed reading it, you're a great author.I will be sure to bookmark your blog and definitely will come back in the foreseeable future. I want to encourage you continue your great job, have a nice day!

Argan Oil said...

Thank you to tell us so much useful information. So nice sharing. I’m glad to read it.

Zolpidem No Prescription said...

This is such a perfect resource that you are supplying and you also give it away for totally free. I appreciate seeing internet sites that realize the value of offering a prime resource for zero cost. I truly loved reading your post. Thanks!

battery world said...

Hey Very informative post. Thanks a lot for sharing such a nice post. Keep Sharing:)

where to buy essential oils said...

Fantastic article just about college! Without any doubts all of us meet any problems with thesis . It is specially problematic when you have another privilege in life. I have had the aforementioned troubles until I have observe a company providing experienced writing services

custom software said...

You made some good points .I did a little research on the topic and found that most people will agree with your blog.

Fridges Leicester said...

This is a good common sense Blog. Very helpful to one who is just finding the resources about this part. It will certainly help educate me.

Sign Installation said...

Interesting and important information. It is really beneficial for us. Thanks

web design company said...

Nice post thanks for sharing with us web design company

Web Design Company India said...

Thanks for sharing very nice post

Your Ad Here