Please subscribe to my feed.

Recently I was setting up a WordPress blog for a friend of mine. What was supposedly to be completed in minutes took me much longer than expected. The installation didn’t seem to start at all but threw out a blank page in IE and in Firefox it asked me to save the installation file. What the heck… the WordPress was the latest 2.3.2 version already, so should be stable and good.
The hosting was on a Plesk server. In the error_log file, I found the following error message which was not alien to me.
PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 233472 bytes) in /var/www/vhosts/domain.com/httpdocs/blog/wp-admin/includes/schema.php on line 103
I think this means that the server did not have enough memory to process the size of the data that it’s required to perform. The default memory alloted to PHP was 8MB and this was fairly small for big applications such as WordPress, especially if you have a lot of plugins. But I wasn’t sure why this also happened to a new installation with the default plugins.
Anyway, to resolve this problem, we have to hack the
ini_set(‘memory_limit’,’32M’);
immediately after the code <?php at the top. This code increases the allowed memory to PHP to 32MB.

Oh yeah, of course you can try a lower memory size and work your way upwards if it still didn’t work. Try smaller sizes such as 16MB, 20MB, and etc, in multiples of 4MB. I didn’t have the patience so I tried 32MB straight.
Save the file. No need to restart the server and try the WordPress installation again.
That’s it. Now your WordPress should run just fine. It worked like a dream in my installation! Hahaha…
Note: Seems like this problem occurs more on servers with Plesk control panel. It never happened to me on my servers with CPanel.
costa
January 10th, 2008 at 3:48 pm
This is the exact message I am getting right now, but mine is quite an old blog and this is the first time I am seeing this message. I have deleted some plugins and can go to my dashboard but still cannot see my actual blog.
Any advise?
Kitkat
January 11th, 2008 at 12:33 am
Costa,
I would advise you to look into the error_log file and see what are the latest error messages in the file. I am almost certain you will see the above error message in the error_log, and what follows will be the PHP file where that error was thrown.
To fix the problem, try adding the code
ini_set(’memory_limit’,’32M’);
to the file which is shown. Add the code to the top of the file, right after <?php.
Wing Loon
January 11th, 2008 at 6:29 am
Cool hack. I didn’t know about that. It didn’t happen to me on DirectAdmin too.
keeyit
January 11th, 2008 at 11:03 am
I remembered I read Neo’s post and he said I do not need to upgrade mine is runing steady and stable..
Mine is WP2.2.1
costa
January 11th, 2008 at 1:41 pm
Thanks. Will check it out, though it is working fine now after i disabled more plugins.
Um homem qualquer
February 5th, 2008 at 4:41 am
Greez, had the same problem, it works now… thanks,
but I have one question,
I don’t know much about computers, all the geeky stuff. What does it mean having a huge memory (instead of a small one)? 32, 16, 8 or whatever? How does it affect to the performance of the site? Is my hosting company billing me an extra for that (I hope not) or what?
Yen
February 8th, 2008 at 12:49 am
Hello, I’m having this kind of problem in my site right now. But it’s not working still. I see that you said 32M but mine is needs a lot more so what should I put in there? Can you please help me? Sorry, I’m just not sure what to do…
Yen
February 8th, 2008 at 3:02 am
Hi, nevermind..I figured it out myself:) Thanks!
Juan Polainas
February 10th, 2008 at 10:52 am
Thaks,
but then I have this new problem:
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/domains/dipublico.com.ar/web/wordpress/wp-admin/includes/plugin.php on line 5
What can I do?
Jennifer
February 14th, 2008 at 8:48 pm
I’m getting pretty much the same error as the last person. What can I do?
“Parse error: syntax error, unexpected T_STRING in /home/jennilyn/public_html/journal/wp-admin/admin-functions.php on line 15″
Kristian
February 20th, 2008 at 10:56 pm
Regarding the unexpected T_String: if you copy the code line directly off of this page, you might get curly quotes instead of plain apostrophes (depending on your editor).
When I replaced the curly quotes with straight ones, the problem was solved on my installation.
FanZy
August 30th, 2008 at 2:52 am
it didn’t work for me…
what can i do ?
Fatal Error: Allowed Memory Size Exhausted in PHP | computeraxe.com
September 22nd, 2008 at 11:08 pm
[...] during installation of WordPress [...]
Silvia
November 26th, 2008 at 10:52 am
Hi, I follow your advice to fix the problem and I put ini_set(’memory_limit’,’32M’);
but it display
Parse error: syntax error, unexpected T_STRING in /home2/ellasson/ellassonasi-www/wp-admin/install.php on line 3
patzaa
November 27th, 2008 at 2:57 pm
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 6144 bytes) in C:\AppServ\www\Joomla\libraries\joomla\utilities\simplexml.php(305) : eval()’d code on line 1
buddha
January 13th, 2009 at 2:31 am
I can see the blog front page, but trying to log into wp-admin or /plugins or /widgets I get this error msg for different pages. I added the code where you said – same error. here are 3 pages with 3 similar errors:
plugins
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 28796 bytes) in /home/vedicfri/public_html/peaceandparadise/wp-includes/update.php on line 156
widgets (partial page)
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 68298 bytes) in /home/vedicfri/public_html/peaceandparadise/wp-admin/includes/widgets.php on line 105
wp-admin
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes) in /home/vedicfri/public_html/peaceandparadise/wp-admin/menu-header.php on line 56
Thanks in advance!
trendslab
July 28th, 2009 at 9:52 pm
this way is good, and the new problem is wordpress 2.8.2 Upgrade,there is an error, like this:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes) in …wp-includes/http.php on line 1345
to see :http://www.trendslab.cn/archives/99.
thanks.
HorseParts
April 25th, 2010 at 7:21 am
I have a Starcraft II Blog. You play?
webadminphph
July 9th, 2010 at 11:08 pm
hi i have on wordpress 3.0
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 122880 bytes) in /var/www/vhosts/hollylodge.liverpool.sch.uk/httpdocs/wp-admin/menu-header.php on line 94
but there is no memory location on install.php file. how can i allocate more.. which file i need to edit. thanks
Chandrashekhar
July 16th, 2010 at 3:47 pm
Nice Hack, Thank you for sharing fix.