Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Build a Simple PHP Application Creating the Menu and Footer Including the Header

I keep getting an error message Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 384

Whenever i try to view the project through localhost i get an error message. Not sure what's causing it so I figured I would post the question before I start completely over

What are you using? MAMP? WAMP? Other?

Hello, I'm using WAMP. The project was working fine up until he got to the part about the header. I followed along with everything but it just not working

3 Answers

This has many causes, but my first check would be that I'm not getting stuck in a loop like:

<?php

function one($stuff)
{
  two($stuff);
}

function two($stuff)
{
  one($stuff);
}

or similar.

Hugo Paz
Hugo Paz
15,622 Points

Hi Phillip,

You probably have a memory leak somewhere in your code. You can use Xdebug to find it.

Zeshan Ahmed
Zeshan Ahmed
13,151 Points

This error can be occurred if the memory requirement exceeds 8 MB. Try following method: in the file /wp_admin/install.php, add the following line of code immediately after the code <?php at the top:

ini_set("memory_limit","32M");

hope this helps. :)