Increase the PHP memory limit
The PHP memory limit (memory_limit) defines the maximum amount of memory a single PHP script is allowed to allocate. If a script exceeds this limit, PHP terminates it with a fatal error: Allowed memory size of X bytes exhausted.
The default value is 128M, which is sufficient for most simple scripts. However, memory-intensive operations can easily exceed this limit — common reasons to raise it include:
- Running a CMS such as WordPress, Joomla, or Drupal with many plugins or extensions
- Processing or resizing large images
- Importing or exporting large datasets
- Using frameworks or libraries that load substantial amounts of code into memory
-
Start MAMP PRO.
-
Stop the servers if they are running.
-
Go to File › Open Template › PHP (php.ini) › [PHP version].
-
If a dialog box appears, read it and click OK.
-
Search for
memory_limit(⌘ F):memory_limit = 128M -
Change the value to your desired limit, for example
256Mor512M:memory_limit = 256M -
Save the file (⌘ S).
-
Close the editor (⌘ W).
-
Start the servers.