Composer PHP Memory Limit on MAMP Pro

Oct 14, 2017 10:38 · 106 words · 1 minute read php

With every PHP update MAMP Pro adds an updated `php.ini file, so previous adaptations are lost after upgrading.

Interestingly, editing a specific PHP versions config file (via File > Edit Template > PHP -> [Version]) doesn’t have any effect on MAMP’s PHP used on the command line. To increase the PHP limit to be able to work with Composer I did the following:

  1. Find the current memory_limit value by running: <br /> php -r "echo ini_get('memory_limit').PHP_EOL;“
  2. Find out which php-ini is currently loaded on the command line by running:

    php -r 'phpinfo();' | grep 'php.ini'

  3. Update that config file

Rinse and repeat with every MAMP update.