Warning: Cannot modify header information

gallamine - April 26, 2009 - 02:20
Project:Drush
Version:6.x-2.0-alpha2
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:won't fix
Description

I just installed Drush to a folder below my Drupal installation. I set up an alias as per the README.txt file. When I run "drush --help" from inside my Drupal instal directory, it prints out the help up to the "sql cli" command, then prints:

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

When I try to execute any Drush commands, like "drush pm install ... " or "drush updatedb" nothing happens. When I run those commands with the "-v" option, I get:

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

Any thoughts on what's going on?

#1

LouBabe - April 29, 2009 - 18:12

I'm getting the same error. Specifically,
Warning: Cannot modify header information - headers already sent by (output started at /tools/drush/includes/drush.inc:434) in /path/to/drupal-root/includes/common.inc on line 141

#2

bmoreinis - May 25, 2009 - 16:38

#3

LouBabe - April 30, 2009 - 20:39

Upon closer inspection, I found the root cause of this, very much related to #304406: drush outputs html to console. I'm using MAMP, and my command line PHP extension wasn't using the same MySql socket. Creating a sym link to the MAMP php executable did the trick. Now drush works great!

#4

gallamine - May 1, 2009 - 21:00

Good find LouBabe ... what exctly do you mean by "Creating a sym link to the MAMP php executable did the trick"?
I'm actually running on a server and it doesn't work either :(

#5

LouBabe - May 1, 2009 - 21:45

E.g.,
$ sudo ln -s /Applications/MAMP/bin/php5/bin/php /usr/bin/php

#6

gallamine - May 1, 2009 - 22:40

I have tried reinstalling Drush. I've also tried the HEAD branch, but the behavior is the same.

#7

moshe weitzman - May 5, 2009 - 00:22
Status:active» won't fix

We can't really help fix broken php CLI installs.

#8

psynaptic - May 23, 2009 - 11:36

I tried creating the symbolic link for my XAMPP installation but get:

ln: /usr/bin/php: File exists

I ran $ /usr/bin/php -v and it returns:

PHP 5.2.6 (cli) (built: Jul 17 2008 23:04:49)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

Not sure what else to do to get this working. It was working before. Not sure what has changed.

Edit: Ok, I got it working. I had drush in my modules folder so was getting lots of errors. Removing drush from the Drupal installation fixed the problems. I also had drush_extra in the modules folder. I needed to remove this too.

#9

kdes - May 25, 2009 - 12:14

I get the same error when I try to run drush dl from my drupal root director (/var/www)

drush --verbose -l http://mysite.com dl
Initialized Drupal 6.11 root directory at /var/www                      [notice]
Initialized Drupal site mysite.com at sites/default                      [notice]

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /opt/drush/includes/drush.inc:439) in /var/www/includes/bootstrap.inc on line 1029

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /opt/drush/includes/drush.inc:439) in /var/www/includes/bootstrap.inc on line 1029

but when I run drush dl from root(/) or another folder (I tried by mistake /usr/bin)

I do not get the above error and the drupal-6.12 is downloaded.

#10

kdes - May 26, 2009 - 18:59

the updatedb command seems to run fine .. however everything else gives the same error as above.

#11

kdes - May 28, 2009 - 19:24

ok.. I tried disabling all modules one by one and shared sign on module was causing the error. When shared sign on module is disabled drush works fine. Does anyone know how to resolve the issue with shared sign on.

#12

kdes - May 30, 2009 - 17:59

I know this is not a drush issue but any help would be appreciated.

#13

flexvixon - July 8, 2009 - 21:00

I have the same issue. Have you learned anything? I am using Single Sign In as well

#14

pobster - September 9, 2009 - 06:38

I got this issue when my memory limit for my CLI php was too low, try running this from the command line;

php -i |grep memory

If like me you forget that the CLI 'version' of php drush uses has different configuration from the normal php (CLI = command line interface) then you'll need to up your memory limit from 8M to something more sensible for Drupal like, 128M.

To see where to change the value, type;

php -i |grep php.ini

Obviously if you're not using the standard php which is installed on your system (think MAMP, etc) then replace 'php' with the actual path to your php binary.

Pobster

 
 

Drupal is a registered trademark of Dries Buytaert.