Hi all, I have been struggling with issuing the command ./craft gc. It shows the following

Delete all trashed items? (yes|no) [no]:yes
Running garbage collection ... PHP Fatal Error 'yii\base\ErrorException' with message 'Allowed memory size of 134217728 bytes exhausted (tried to allocate 16384 bytes)'

the allowed memory size equates to 128MB. I attempted to increase the limit but it still showed the 128M Allowed memory size.

What I've Done

  • I have set 'phpMaxMemoryLimit' => '1024M' in config/general.php
  • I have set memory_limit = 1024M in the php.ini
  • I executed the command php --ini |grep "Loaded Configuration File" which showed the correct path
  • I made a webroot/phpfile with <?php phpinfo(); which showed both the correct path, and correct memory_limit
  • I checked admin/utilities/php-info which showed the correct memory_limit


  • PHP version 7.3.3
  • OS version Darwin 19.2.0
  • Craft edition & version Craft Pro 3.3.19
  • Mamp PRO version 5.3

1 Answer 1


Sounds like you don't have the correct PHP loading in your CLI. You should try using MAMP’s PHP Executable in your Terminal.

  • Thanks for the suggestion @Oli, but I've already done this. .bash_profile has export PATH="/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php7.3.3/bin:${PATH}" set already Jan 24, 2020 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.