Solving the "Allowed memory size of XXX bytes exhausted" Fatal Error
June 17, 2009, filed under Quick Internet Tips
Today when I was about to upgrade one of my blogs to Wordpress 2.8 I encountered a "Allowed memory size of 33554432 bytes exhausted" fatal error. That was not the first time I got the error message and I can see that there were many others had gone through the experience and many will too in the future. And so I asked my hosting live chat support to see if there were any new alternative solutions other than what I usually do to solve the memory error.
It was a fast response and although I was still suggested to modify the php.ini file, they gave me a very detailed step by step guidance on how to do it. So I’d like to post the steps here and if you’re using CPanel you can certainly apply these. Thanks for Kyle from Hostmonster for the assistance!
- Step 1- Login into your cPanel.
- Step 2- Under the Software/Services category, click on the PHP Config icon.
- Step 3- In this screen, there is a section called “Install Default php.ini”. Under that section, please check mark the "IonCube" and the "SourceGuardian" check boxes (Many commercial php scripts need these turned on – if you think your script may not require the IonCube or SourceGuardian packages, it is okay to not check mark the boxes – but it will not hurt anything to check mark both boxes.).
- Step 4- Under the same section, click the "INSTALL PHP.INI MASTER FILE" button.
- Step 5- You have just successfully installed the "php.ini.default" file . But the next step is to rename it from "php.ini.default" to just "php.ini" to make it active. You can do the Rename in the File Manager screens. Under the Files category in your cPanel, please click on the File Manager icon.
- Step 6- When you click on the File Manager icon, you should get a popup dialog titled "File Manager Directory Selection". (If you do not see the popup dialog, then you need to click on the link at the bottom of your cPanel called "reset all interface settings" – and then Refresh your cPanel and click on the File Manager icon again.) In the popup dialog screen, click the "Web Root (public_html/www)" and the "Show Hidden Files (dotfiles)." choices. Finally please click the "Go" button.
- Step 7- If you already have a "php.ini", I would recommend that you Rename the file to "php.iniOld" in case you need ever need it.
- Step 8- Find the file that you just installed called "php.ini.default", Right-Click the file and choose the Rename option.
- Step 9- A new popup dialog called Rename should appear. Please start pressing your Backspace on your keyboard and you will start to see the letters disappear. Keep removing the letters until you see only "php.ini", and then click the Rename File button.
- Step 10- Your php.ini file is now active and fully functional !! Additionally, some users need to make adjustments to this file. To edit the file, you just Righ-Click the php.ini file and choose the Edit option, and then change the value like these examples show:
- a. To increase your memory for your php pages: memory_limit = 2M —> memory_limit = 100M
or - b. To turn on your Register Globals: register_globals = Off —> register_globals = On (We don’t recommend that you change this flag unless you know what you are doing.)
or - c. To increase the maximum file size for uploading (there are two flags that you have to change):
post_max_size = 2M —> post_max_size = 100M
upload_max_filesize = 2M —> upload_max_filesize = 100M - d. To turn on PDO, add this line of code to your php.ini file:
extension=pdo_mysql.so
extension=pdo.so
extension=pdo_sqlite.so
extension=sqlite.so
- a. To increase your memory for your php pages: memory_limit = 2M —> memory_limit = 100M
- Step 11- Important: The php.ini file is generally directory specific. If you have "PHP5 (Single php.ini)" or "PHP5 (FastCGI)" selected in your Php Config screen, then you should not need to do anything else. If you do NOT have either of those selected, then you may need to copy the php.ini file into all of the subfolders inside your public_html directory. This may be dozens and dozens of subfolders that you have to copy the file into. Also, sometimes it can take between 15-30 minutes before the system recognizes the php.ini file or any changes that you have made in the file.
I hope that helps. And just in case if you’re looking for a new hosting account, please consider HostMonster. Right now they’re also having a promotional price of $5.95/month with unlimited bandwidth, space and domains. Plus you’ll get one free domain for a lifetime. Check it out!
UPDATE: While I was browsing for this particular issue, I found an extra help that may aid you if the above steps don’t work. Thanks to Nihar’s World for the tips! Look for steps 6, 7 and 8.
Read more:
Avoid Twitter Phishing with Flagfox for Firefox In the most recent article on TwiTip, 33 high profile...
Resolving The Feed Too Large Error Just now I reviewed my web crawl errors using Google...
Blogging – HomeBiz Resource Auto Theme Change Solution After my recent post on how I thought the problem...
CoComment – Integrated Tracking of Your Wide Spread Comments How do you check responses to your comments? How do...






Cheers this helped me out when upgrading wordpress.