title: MAMP PHP Fatal error: Allowed memory size exhausted
body: <p>I understand it is a bit harder to diagnose and help when websites are on local servers, but I was hoping that someone else has run into this or has a general idea what and why this is happening?
  This has to do with wordpress however the bulk of the problem I feel doesn't have anything to do with it but focuses on MAMP and this error I get.</p>
  
  <p>I've now just tried to migrate yet another website to my local server and for some reason it just doesn't work….All I get is a white screen.
  I've used an error logging technique from <a href="http://codex.wordpress.org/Editing_wp-config.php#Configure_Error_Logging" rel="nofollow">http://codex.wordpress.org/Editing_wp-config.php#Configure_Error_Logging</a></p>
  
  <pre><code>/**
   * This will log all errors notices and warnings to a file called debug.log in
   * wp-content (if Apache does not have write permission, you may need to create
   * the file first and set the appropriate permissions (i.e. use 666) )
   */
  define( 'WP_DEBUG', true );
  define( 'WP_DEBUG_LOG', true );
  define( 'WP_DEBUG_DISPLAY', false );
  @ini_set( 'display_errors', 0 );
  </code></pre>
  
  <p>I've also set my DEBUG to true.
  So I check out this debug.log file I've created and see this error</p>
  
  <p>[03-Sep-2014 22:50:45] PHP Fatal error:  Allowed memory size of 41943040 bytes exhausted (tried to allocate 30720 bytes) in /Applications/MAMP/htdocs/_ANEW/wp-admin/includes/misc.php on line 620</p>
  
  <p>What the heck does that mean?</p>
  
  <p>I went into the location where the "error" is popping up, and just removed that line 620 which looked like this</p>
  
  <pre><code>&lt;input name="admin_color" id="admin_color_&lt;?php echo esc_attr( $color ); ?&gt;" type="radio" value="&lt;?php echo esc_attr( $color ); ?&gt;" class="tog" &lt;?php checked( $color, $current_color ); ?&gt; /&gt;
  </code></pre>
  
  <p>Then there is another error line on the same file, and then again. So as a test I deleted all the content from the page. Then I get ANOTHER error line on the post.php page..</p>
  
  <p>Here's the full debug.log file</p>
  
  <pre><code>[03-Sep-2014 22:50:45] PHP Fatal error:  Allowed memory size of 41943040 bytes exhausted (tried to allocate 30720 bytes) in /Applications/MAMP/htdocs/_ANEW/wp-admin/includes/misc.php on line 620
  [03-Sep-2014 22:55:02] PHP Fatal error:  Allowed memory size of 41943040 bytes exhausted (tried to allocate 30720 bytes) in /Applications/MAMP/htdocs/_ANEW/wp-admin/includes/misc.php on line 621
  [03-Sep-2014 22:55:30] PHP Fatal error:  Allowed memory size of 41943040 bytes exhausted (tried to allocate 7680 bytes) in /Applications/MAMP/htdocs/_ANEW/wp-admin/includes/misc.php on line 616
  [03-Sep-2014 22:55:50] PHP Fatal error:  Allowed memory size of 41943040 bytes exhausted (tried to allocate 7680 bytes) in /Applications/MAMP/htdocs/_ANEW/wp-admin/includes/misc.php on line 618
  [03-Sep-2014 22:56:05] PHP Fatal error:  Allowed memory size of 41943040 bytes exhausted (tried to allocate 122880 bytes) in /Applications/MAMP/htdocs/_ANEW/wp-admin/includes/post.php on line 271
  [03-Sep-2014 22:56:48] PHP Fatal error:  Allowed memory size of 41943040 bytes exhausted (tried to allocate 122880 bytes) in /Applications/MAMP/htdocs/_ANEW/wp-admin/includes/post.php on line 281
  [03-Sep-2014 23:29:12] PHP Fatal error:  Allowed memory size of 41943040 bytes exhausted (tried to allocate 122880 bytes) in /Applications/MAMP/htdocs/_ANEW/wp-admin/includes/post.php on line 271
  [03-Sep-2014 23:32:58] PHP Fatal error:  Allowed memory size of 41943040 bytes exhausted (tried to allocate 122880 bytes) in /Applications/MAMP/htdocs/_ANEW/wp-admin/includes/post.php on line 271
  </code></pre>
  
  <p>I've googled around and it seems that servers give you enough memory and most things shouldn't even use this much space.. so then what might be happening?</p>
  
  <p>I've also looked for the php.ini file but couldn't find it. Do I need to have MAMP PRO?</p>
  
  <p>I'm so confused.So any advice or suggestions would be appreciated. </p>