Skip to content
MAMP PRO Documentation

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
  1. Start MAMP PRO.

  2. Stop the servers if they are running.

  3. Go to File › Open Template › PHP (php.ini) › [PHP version].

  4. If a dialog box appears, read it and click OK.

  5. Search for memory_limit ( F):

    memory_limit = 128M
  6. Change the value to your desired limit, for example 256M or 512M:

    memory_limit = 256M
  7. Save the file ( S).

  8. Close the editor ( W).

  9. Start the servers.


PHP how-to guides