I am using Drush 7 version on my MAC with MAMP PRO. When I am using any command of Drush it shows me an error message :

PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 12288 bytes) in /Users/pankajsachdeva/drush/includes/preflight.inc on line 49

Can anybody help me to get out of it?

  • Yep, you need to increase your PHP memory limit to something above 256kb – Clive Dec 17 '15 at 11:55
  • @Clive, I already set it to 512MB. – Pankaj Sachdeva Dec 17 '15 at 11:59
  • 3
    PHP disagrees @Pankaj - either you have a bugged version of PHP, or you've set it in the wrong place. PHP CLI has a 262,144 byte memory limit according to the error message – Clive Dec 17 '15 at 11:59
  • Have you restarted MAMP after making the change? – Leigh Dec 17 '15 at 12:31
  • @Leigh Mason, yes restarted it. – Pankaj Sachdeva Dec 17 '15 at 12:40

Drush uses the CLI version of PHP, which has its own php.ini file. You should locate this php.ini file on your installation and increase the memory limit. It can be on different places depending on how you installed the PHP.

It is generally around the same folder with the regular php.ini file but has something with cli.

For example on my Linux machine, the regular php.ini file is located under


And the CLI-Version is located under:


| improve this answer | |

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