The Drupal tweaks module looks very promising since it allows you to set PHP's memory limit from within Drupal (using settings.php did not work for me). In fact, the out of memory errors in conjunction with Drush did disappear on one of my sites after using this module, but I got a new error instead:

Fatal error: Call to undefined function  theme() in /home/oneworl1/public_html/sitename/includes/common.inc on line 894

In order to debug this error, I installed Drupal 6.13 out of the box and was testing 'drush status' which was working fine. Then I added the Drupal tweaks module as the only module and tested again 'drush -d status' and this was the result:

[~/public_html/test]# drush -d status
Found command: status [0.013 sec]                                                                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.014 sec]                                           [bootstrap]
Initialized Drupal 6.13 root directory at /home/oneworl1/public_html/test [0.02 sec]                            [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.02 sec]                                            [bootstrap]
Initialized Drupal site default at sites/default [0.02 sec]                                                     [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.02 sec]                                   [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.023 sec]                                       [bootstrap]
Successfully connected to the Drupal database. [0.023 sec]                                                   [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.026 sec]                                           [bootstrap]
session_start(): Cannot send session cookie - headers already sent by (output started at                     [warning]
/home/oneworl1/drush/includes/drush.inc:439) [0.027 sec]
session_start(): Cannot send session cache limiter - headers already sent (output started at                 [warning]
/home/oneworl1/drush/includes/drush.inc:439) [0.027 sec]
Constant DRUPAL_MINIMUM_PHP_MEMORY_LIMIT already defined [0.029 sec]                                            [notice]
Trying to get property of non-object [0.037 sec]                                                                [notice]

Fatal error: Call to undefined function  theme() in /home/oneworl1/public_html/test/includes/common.inc on line 894
Trying to get property of non-object [0.037 sec]                                                                [notice]
Drush command could not be completed. [0.037 sec]                                                            [error]

I have followed this issue closely in the Drush issue queue and did also not find a way to set the PHP memory in a way that worked except maybe with the Drupal tweaks module. So if there is a way the two can work together, this might solve a few more problems.

Comments

moshe weitzman’s picture

Status: Active » Closed (fixed)

drush users are expected to know a bit about the command line environment they are working in. this is at best a docs issue.

Gerald Mengisen’s picture

Sure, but I've tried everything else I could find against the out of memory error (e.g. 'php -c ../php.ini /home/oneworl1/drush/drush.php status' pointing at a php.ini of 128M instead of 64M and still got the same out of memory error). The Drupal tweaks module looked like another avenue to make Drush work on my provider's server. Any other ideas?

Gerald Mengisen’s picture

Now with much more Drush experience under the belt, I can say that the error came from a contributed module and not from Drush. Threads like this also point in that direction. Sorry for having opened the ticket in here.