I installed Drush today, had it working fine, and then promptly created memory havic by (I believe) installing too many modules at once. What can I say? The power of drush went *straight* to my head!
Either way, I've tried many fixes and the drupal site itself works but all drush commands produce:
Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 30720 bytes) in /home/lterpal/drush/includes/environment.inc on line 350
Or, if the command is preceded by sudo:
Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 30720 bytes) in /home/lterpal/drush/includes/environment.inc on line 437
I've tried increasing the memory (post-error) in these places to no avail:
/etc/php5/cli/php.ini
/var/www/mysite/sites/default/settings.php added: ini_set('memory_limit', '150M');
/etc/php5/apache2/php.ini
Also restarted apache, rebooted , $ source .bashrc
My setup: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.10 with Suhosin-Patch
My experience thus far seems very similar to #457416: allowed memory size error: Drush CLI may use different php settings from "regular" Drupal
Comments
Comment #1
greg.1.anderson commenteddrush statuswill tell you exactly which php.ini drush is using. Maybe 150M isn't enough? I usually am fine with 128M, but I suppose it depends on exactly how many modules you've installed, and what they're doing...Comment #2
kbk commentedOK, so right after my post, I noticed Moshe's comment here. The command listed did the trick for me. Feel free to mark as dup of #671898: installsite needs more memory than php cli has by default.
BTW, my experience with drush thus far has been analogous to my first car: excitement, drive fast, crash, hooked. Thanks for your work on this.
Comment #3
kbk commentedHere's the output of the status command:
$ php -d memory_limit=64M /home/mydir/drush/drush.php status
I upped the memory to 280mb but, but all "$ drush" commands still produce the original errors. When the problem started my memory was at the default (16 or 32mb). I also noticed that the above status command works down to 4mb. For example:
$ php -d memory_limit=4M /home/mydir/drush/drush.php status
*Edited to obfuscate directory name
Comment #4
moshe weitzman commented