Most PHP applications can easily handle the default PHP memory limit of 8 MB. But more complex web applications, like content management- or blog-systems, do need an increased memory-limit. With MMAP PRO you can easily increase the PHP memory limit. Therefore you simply have to change some data within the php.ini file.Here is how it works:
- Start MAMP PRO
- Stop the server if it's running
- Choose Menu -> File -> Edit Template -> PHP4 php.ini (If you want to change the memory limit for PHP5, then choose PHP5 php.ini)

- The PHP ini file will be opened.
- If a dialogue box pops up, read it and confirm with OK
- Search (Command-F) for "memory_limit" (without quotes)
- You should get the following line:
memory_limit = 8M ; Maximum amount of memory a script may consume (8M) - Now you can change the default value of 8M. For instance. into 32M or even more (like 128M)
- Save (Command-S) your changes.
- Close (Command-W) the file.
- Start the Server.
Please be aware of the fact that some ISP's are limiting the PHP Memory by default. This means, even if everything works fine on your local system, it probably will not work on the live system of your ISP.

Thanks - that's a great tip and a big help. Explains why I've been getting a blank page in my php application.
ReplyDeleteThis caught me out to when I was trying to import a Wordpress DB backup in phpMyAdmin (would only import 6 out of 19 tables) then crap out. Increasing the memory limit made all the difference.
ReplyDeleteIs there any chance that a site (taken from live and made local to work on fixing it up) might be too large for MAMP to handle? I have changed the memory limit as you show here to 128, but still get the white screen of death each time I save anything (literally, any changes I make to any component of the site) on my drupal site.
ReplyDeleteAny thoughts? I'm at a complete loss and my sitework has been held up considerably....
@blank: Please check you php error log to see what's happen.
ReplyDeleteIt gave only: PHP Fatal error: Call to undefined function _forum_get_vid() in /Applications/MAMP/htdocs/.../includes/common.inc(1685) : eval()'d code on line 2
ReplyDeleteHowever, the same common.inc worked perfectly on the live site, and I haven't been successful with tracking down what might have been causing that particular error.
Good news: it appears that there were exceedingly large tables in my database related to searching (we think perhaps form a Google search function we have on the site) that appear to be the culprit. We've dumped those tables and so far the local site is up and running as it should. Fingers still crossed!
Any further suggestions you have would be wonderful though!
I followed the instructions above to no avail, at first.
ReplyDeleteThen I took a look around for .htaccess files in my mamp htdocs directories, and sure enough, discovered that, for some reason, there was a memory limit directive imposed locally.
So, if anyone followed the above directions and it didn't help, look for htaccess overrides!
Thanks!
ReplyDeleteThanks! :)
ReplyDeleteI just installed a new version of MAMP Pro, and after going to File > Edit Template, it only shows PHP 1, PHP 2, and PHP 3, and they are all greyed out. How do I get it to show PHP 5 and make php.ini editable?
ReplyDeleteThis article saved my ass! Thanks!
ReplyDeleteDitto! Thanks!
ReplyDeleteThanks So much... been trying to solve this problem for ages, as it only happened with some sites.
ReplyDeleteGreat Work
Thanks, you saved my day ;)
ReplyDeleteThank you so much, this has been a great help!
ReplyDeleteJen
Thanks, i was stuck after using Backup Buddy for transferring a live site to Mamp, and this worked :)
ReplyDeleteVery good article!! Thankyou very much!
ReplyDeleteIs there a way to do this in MAMP (not pro) ? I've changed the php.ini but no update in phpinfo().
ReplyDeleteHi Berkan, in phpInfo you can see the Loaded Configuration File: /Applications/MAMP/bin/php/php5.4.4/conf/php.ini
DeleteChanging that file will probably work :)
Did not work, I tried it. The screen is still white. But thank you for the file directory.
DeleteNope, didn't work. Thanks anyway.
DeleteThis worked for me. Cheers :D
ReplyDelete@Paul ^
Deletethere is more than 1 way to increase the limit: http://newexception.com/php-increase-memory-limit
ReplyDelete