in Web & Tech

Composer PHP Memory Limit on MAMP Pro

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:
    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.

Write a Comment

Comment

  • Related Content by Tag