I have tried both the HEAD and the 6.x-2.0 versions of Drush. I have installed them to a directory below Drupal (../public_html/drush and ../public_html/drupal/...). I'm on a VPS and I can't use "ln", so, as per the README.txt file, I created an alias: alias drush='php ~/path/to/drush/drush.php'.

When I type "drush" when in the Drupal directory, it prints the list of examples up to "sql cli" and then prints the following error(s):

Warning: Cannot modify header information - headers already sent by (output started at /home/admin/domains/sitename.net/public_html/drush/includes/drush.inc:434) in /home/admin/domains/sitename.net/public_html/test/includes/install.inc on line 618

Warning: Cannot modify header information - headers already sent by (output started at /home/admin/domains/sitename.net/public_html/drush/includes/drush.inc:434) in /home/admin/domains/sitename.net/public_html/test/includes/install.inc on line 619

Additionally, if I try and execute a drush command, like "drush status" or "drush dl" nothing happens. If I try those commands with the "-v" option, the following is printed:

Invalid input: -v needs to be followed by an argument.                                                                          [error]
The command 'drush.php status' could not be executed.                                                                           [error]

I am at a loss as to why this is. I've made sure my permissions match those who have Drush working, and the alias obviously works, since Drush will print the list of commands, but nothing else works.

Help!

CommentFileSizeAuthor
#11 drush_455848.patch1.47 KBdrewish
#10 drush_455848.patch1.09 KBdrewish

Comments

dcaillibaud’s picture

I had the same pb with drush-6.x-2.0-alpha2, but with drush-HEAD-all-versions.tar.gz of 2009-May-07 solved it :-)

gallamine’s picture

I have installed the latest HEAD version (May 07). The "Cannot modify header information" warning goes away.

However, drush still won't execute any commands. None of the commands seem to do anything. When i run them with the -v command, I get the following sort of error:

Invalid input: -v needs to be followed by an argument.                                                                          [error]
The command 'drush.php cache clear' could not be found.                                                                         [error]

Any thoughts?

dcaillibaud’s picture

If you have a multi-sites install, don't forget the -l argument !

gallamine’s picture

Status: Active » Fixed

@dcaillibaud,

That worked! I'm only using one site, and I've never messed with "multi-site" (that I know of) but that seemed to do the trick. Thanks a ton!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

druvision’s picture

The multi-site was my issue. once I copied the site definitions to the default site profile, the issue was resolved.

jazzslider’s picture

Version: » All-versions-3.0-rc4
Status: Closed (fixed) » Active

Hello!

I'm still experiencing this issue using the latest release of drush 3.0 (RC4, I believe), and not using a multi-site.

Command output:

host:/var/www/mysite# drush dl admin_menu -v
Initialized Drupal 6.16 root directory at /var/www/mysite                                                                                        [notice]
Initialized Drupal site default at sites/default                                                                                                        [notice]
Undefined index:  scheme environment.inc:702                                                                                                            [notice]
Undefined index:  user environment.inc:703                                                                                                              [notice]
Undefined index:  host environment.inc:704                                                                                                              [notice]
Cannot modify header information - headers already sent by (output started at /usr/local/drush/includes/drush.inc:794) install.inc:618               [warning]
Cannot modify header information - headers already sent by (output started at /usr/local/drush/includes/drush.inc:794) install.inc:619               [warning]
Drush command could not be completed.                                                                                                                [error]

Couple of important points I've noted:

  • I've just used the "dl" command as an example; in reality, I get the same errors no matter what drush command I run.
  • The failed header() calls are in the install_goto() function; I have to admit I'm not sure why that function would ever need to be run in a CLI environment.

Anyone have any ideas?

Thanks!
Adam

mpettitt’s picture

There are some modules around that can interfere with Drush - mobile_tools springs to mind (it does the platform detection and modifies headers at a very early stage of loading), but I'm guessing this is a fresh install if you're aiming to get admin_menu onto it?

jazzslider’s picture

Yeah, this is a a clean install of Drupal 6.16; no custom or contrib modules present at this point.

drewish’s picture

Version: All-versions-3.0-rc4 » All-versions-3.1
Status: Active » Needs review
StatusFileSize
new1.09 KB

I was having this problem when E_ALL is enabled on a new site with a settings.php file but no database connection string.

drewish’s picture

StatusFileSize
new1.47 KB

actually might as well fix the D7 version too.

drewish’s picture

perusio’s picture

Well I patched drush with your patch and the annoying PDO error is gone. But now I get this:

>drush sm -d -v
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.25 sec, 3.73 MB]                                                                                    [bootstrap]
Initialized Drupal 7.0-alpha6 root directory at /home/appa/sites/d7 [0.32 sec, 4.91 MB]                                                                          [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.65 sec, 5.34 MB]                                                                                    [bootstrap]
Initialized Drupal site default at sites/default [0.66 sec, 5.34 MB]                                                                                             [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.79 sec, 5.34 MB]                                                                           [bootstrap]

Fatal error: Class 'DrupalPublicStreamWrapper' not found in /home/appa/drupal/drush/commands/core/core.drush.inc on line 396

Call Stack:
    0.0100     118908   1. {main}() /home/appa/drupal/drush/drush.php:0
    0.0931    1534740   2. drush_main() /home/appa/drupal/drush/drush.php:40
    0.9242    5670712   3. drush_bootstrap() /home/appa/drupal/drush/drush.php:75
    0.9245    5671616   4. drush_set_error() /home/appa/drupal/drush/includes/environment.inc:179
    0.9246    5672300   5. drush_command_invoke_all() /home/appa/drupal/drush/includes/drush.inc:1698
    0.9246    5673024   6. call_user_func_array() /home/appa/drupal/drush/includes/command.inc:414
    0.9246    5673512   7. drush_command_invoke_all_ref() /home/appa/drupal/drush/includes/command.inc:0
    0.9250    5676216   8. call_user_func_array() /home/appa/drupal/drush/includes/command.inc:425
    0.9250    5676624   9. core_drush_help() /home/appa/drupal/drush/includes/command.inc:0
    0.9251    5677148  10. _core_site_credentials() /home/appa/drupal/drush/commands/core/core.drush.inc:349
    0.9251    5677148  11. _core_site_status_table() /home/appa/drupal/drush/commands/core/core.drush.inc:364
    0.9258    5679896  12. _core_path_aliases() /home/appa/drupal/drush/commands/core/core.drush.inc:467

Drush command could not be completed. [0.92 sec, 5.42 MB]                                                                                                     [error]

Here's my php -m output


apc
bcmath
bz2
calendar
ctype
curl
date
dba
dom
exif
ffmpeg
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mcrypt
memcache
mime_magic
mysql
mysqli
ncurses
openssl
pcntl
pcre
PDO
pdo_mysql
posix
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
standard
suhosin
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
translit
uploadprogress
uuid
wddx
xdebug
xml

Any ideas? Thanks.

moshe weitzman’s picture

Status: Needs review » Fixed

seems harmless so i committed this ... #13 is a different issue

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

marekbirkholz’s picture

Title: Drush commands, "could not be executed." and "Warning: Cannot modify header information" » Drush commands, "'en custom_breadcrumbs could not be executed."
Component: Code » Base system (internal API)
Category: Bug report » Support request
Status: Closed (fixed) » Closed (cannot reproduce)
Issue tags: +drush command enable (en) could not be executed

Hello I try using drush working on my drupal site, but I am stuck with this, I get the following while try to enabling modules :

MacBook-Air-2:all mari1$ sudo drush en -y custom_breadcrumbs custom_breadcrumbs_views custom_breadcrumbsapi custom_breadcrumbs_paths
Command pm-enable needs a higher bootstrap level to run - you will [error]
need to invoke drush from a more functional Drupal environment to run
this command.
The drush command 'en custom_breadcrumbs custom_breadcrumbs_views [error]
custom_breadcrumbsapi custom_breadcrumbs_paths' could not be
executed.
Drush was not able to start (bootstrap) the Drupal database. [error]
Hint: This may occur when Drush is trying to:
* bootstrap a site that has not been installed or does not have a
configured database. In this case you can select another site with a
working database setup by specifying the URI to use with the --uri
parameter on the command line. See `drush topic docs-aliases` for
details.
* connect the database through a socket. The socket file may be
wrong or the php-cli may have no access to it in a jailed shell. See
http://drupal.org/node/1428638 for details.

Drush was attempting to connect to:
Drupal version : 7.30
Site URI : http://default
Database driver : mysql
Database username : root
Database name : d7_mb
Default theme : garland
Administration theme : garland
PHP executable : /usr/bin/php
PHP configuration :
PHP OS : Darwin
Drush version : 6.2.0
Drush configuration :
Drush alias files :
Drupal root : /Applications/MAMP/htdocs/drupal
Site path : sites/default
File directory path : sites/default/files

thanks a lot for tips

Marek