The pm-download command is working so I can update modules individually, but I can't do it in bulk. Both drush 6.2.0 and 6.1.0 give an error.

The output of drush up --debug is the following.

Bootstrap to phase 0. [0.01 sec, 2.24 MB]
[bootstrap] Drush bootstrap phase : _drush_bootstrap_drush() [0.01 sec, 2.37 MB] [bootstrap] Cache HIT cid: 6.2.0-commandfiles-0-da12a99782b48770f5d9ad8965ca5448 [0.02 sec, 2.39 MB] [debug] Bootstrap to phase 0. [0.09 sec, 6.4 MB]
[bootstrap] Bootstrap to phase 6. [0.14 sec, 6.4 MB]
[bootstrap] Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.14 sec, 6.41 MB] [bootstrap] Initialized Drupal 7.24 root directory at /path/to/site [0.16 sec, 7.43 MB] [notice] Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.16 sec, 7.44 MB] [bootstrap] Initialized Drupal site default at sites/default [0.16 sec, 7.44 MB]
[notice] Cache HIT cid: 6.2.0-install_profile-66ecfeb9791a023150773849f1550c5d [0.16 sec, 7.45 MB] [debug] Cache HIT cid: 6.2.0-commandfiles-2-699657487b88e8b0c2ede2984aa12913 [0.16 sec, 7.45 MB] [debug] Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.17 sec, 7.47 MB] [bootstrap] Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.17 sec, 7.51 MB] [bootstrap] Successfully connected to the Drupal database. [0.17 sec, 7.51 MB]
[bootstrap] Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.18 sec, 8.14 MB] [bootstrap] Cache HIT cid: 6.2.0-install_profile-66ecfeb9791a023150773849f1550c5d [0.37 sec, 26.15 MB] [debug] Cache HIT cid: 6.2.0-commandfiles-5-8aee30ce3a469e89d0725cfb79ceb51b [0.37 sec, 26.16 MB] [debug] Drush bootstrap phase : _drush_bootstrap_drupal_login() [0.38 sec, 26.62 MB] [bootstrap] Successfully logged into Drupal as Guest (uid=0) [0.38 sec, 26.63 MB] [bootstrap] Found command: pm-update (commandfile=pm) [0.38 sec, 26.63 MB]
[bootstrap] Calling hook drush_pm_update [0.71 sec, 26.97 MB]
[debug] Loading release_info engine. [0.9 sec, 29.07 MB]
[notice] Loading version_control engine. [0.9 sec, 29.17 MB]
[notice] Loading package_handler engine. [0.91 sec, 29.19 MB]
[notice] Executing: wget --version Including /usr/local/Cellar/drush/6.2.0/libexec/commands/pm/updatecode.pm.inc [0.93 sec, 29.21 [bootstrap] MB] Calling hook drush_pm_updatecode_validate [0.94 sec, 29.31 MB]
[debug] Returned from hook drush_pm_updatecode_validate [0.94 sec, 29.31 MB] [debug] Calling hook drush_pm_updatecode [0.94 sec, 29.32 MB]
[debug] Cache HIT cid: 6.2.0-alias-path--2c8463220c4fed24dfb54242bc0f682e [0.94 sec, 29.36 MB] [debug] Backend invoke: --backend=2 --verbose --debug --root=/path/to/site [command] --uri=site.local pm-updatestatus 2>&1 [1.26 sec, 29.37 MB] --backend=2 --verbose --debug --root=/path/to/site --uri=site.local [notice] pm-updatestatus 2>&1 [1.26 sec, 29.38 MB] Illegal string offset 'site' backend.inc:1013 [1.27 sec, 29.38 MB]
[warning] The command could not be executed successfully (returned: sh: --backend=2: command not found [error] , code: 127) [1.27 sec, 29.38 MB] Returned from hook drush_pm_updatecode [1.27 sec, 29.36 MB] [debug] Changes made in drush_pm_updatecode have been rolled back. [1.27 sec, 29.37 MB] [rollback] Command dispatch complete [1.27 sec, 29.34 MB]
[notice] Returned from hook drush_pm_update [1.28 sec, 27.27 MB]
[debug] Command dispatch complete [1.28 sec, 27.24 MB]
[notice] Timer Cum (sec) Count Avg (msec) page 1.113 1
1113.33 Peak memory usage was 31.64 MB [1.28 sec, 27.24 MB] [memory]

The issue happens under OS X Mountain Lion and PHP 5.4.20, and continued after upgrading to Mavericks.

2 Answers 2


This is happening because Drush is trying to find the local Drush executable via $drush = realpath($_SERVER['argv']['0']);. In this context, realpath is returning FALSE, because $_SERVER['argv']['0'] does not exist.

As a workaround for this particular problem (which is that pm-update cannot call updatedb), you could run drush pm-updatecode followed by drush updatedb.


If you work around the problem instead of solving it, you will also run into this same issue with other commands, such as sql-sync.

  • This is on a local install, it happens when using an alias or when running from the drupal directory.
    – Sphinges
    Jan 12, 2014 at 3:29
  • Run the command again with the --debug flag; show the full command you are running, and all of the output. Also, please specify your php and Drupal versions, and what O.S. you are running on. Drush shouldn't be including --backend=2 unless you are using a site alias with a 'remote-host' entry set, so the results you are seeing are unexpected. Jan 12, 2014 at 3:49
  • Thanks for taking the time to help greg, I added the info to the OP.
    – Sphinges
    Jan 12, 2014 at 15:38
  • I'm not sure why Drush can't find your executable. You could try to diagnose this via drush ev 'return $_SERVER["argv"]["0"];' Jan 12, 2014 at 18:00
  • drush ev 'return $_SERVER["argv"]["0"];' returns '/usr/local/Cellar/drush/6.2.0/libexec/drush.php'
    – Sphinges
    Jan 12, 2014 at 19:23

I used drush pm-updatecode --debug from inside the Drupal root and it shows the failure. I think drush can't find out where it is. The first line of the output is this: "C:\Users\dj\AppData\Roaming\Composer\vendor\drush\drush\drush" --backend=2 --verbose --debug --root="E:\DJs Documents\public_html\Drupal_80" --uri=http://default

The "default" seems to be the problem. Also,

drush ev 'return $_SERVER['argv']['0']);'

returned nothing (no error either).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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