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 |
Jump to:
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 619When 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
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
#3
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
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
E.g.,
$ sudo ln -s /Applications/MAMP/bin/php5/bin/php /usr/bin/php#6
I have tried reinstalling Drush. I've also tried the HEAD branch, but the behavior is the same.
#7
We can't really help fix broken php CLI installs.
#8
I tried creating the symbolic link for my XAMPP installation but get:
ln: /usr/bin/php: File existsI ran
$ /usr/bin/php -vand 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
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
the updatedb command seems to run fine .. however everything else gives the same error as above.
#11
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
I know this is not a drush issue but any help would be appreciated.
#13
I have the same issue. Have you learned anything? I am using Single Sign In as well
#14
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 memoryIf 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.iniObviously 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