Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
I think this is not a bug with drush per se. You should have a CLI version of PHP installed or drush will not work, simply. CGIs versions are different and unsupported.
Spoke too soon. I was tweaking other code and forgot that I had explicitly set ARGC to a positive value. Even so, when I dump $_SERVER, ARGC is capitalized if it shows up at all. The problem I'm getting is that it seems to be completely ignoring the command line options no matter what I do.
On GoDaddy Linux shared servers, the PHP command-line installation is in /usr/local/php5. So to get Drush to work properly on these servers, it's easiest to just create an 'alias' for drush. If you have Drush installed in your home folder, for example, you can just add this line to your .bash_profile file:
alias drush='/usr/local/php5/bin/php ~/drush/drush.php --php=/usr/local/php5/bin/php'
(Adjust for your particular install location.) To complete the process, log out. Next time you log into your site via SSH you'll be able to use drush.
I still have an issue with the drush updb command. It does not completely finish because of the error below:
drush updb
The following updates are pending:
colorbox module :
7001 - Delete the unused colorbox_login_form variabel.
Do you wish to run all pending updates? (y/n): y
The command could not be executed successfully (returned: [error]
Content-type: text/html
drush is designed to run via the command line., code: <em
class="placeholder">0</em>)
Finished performing updates.
Drush is not using the same php when it calls itself as it is when you run drush from the command line. This is sometimes seen when you are running drush via an alias and your PATH is not right, or occasionally on some hosts with strange security models (e.g. GoDaddy). In general, you should make sure that the correct PHP is on your PATH, and that the 'drush' command is on your PATH and is not an alias.
If you must use an alias, you must specify a correct --php option that specifies the path to php and any PHP options that you need.
Hey,thinkyhead,
I use the godaddy hosting .why can't find the .bashrc or .bash_history?Could you tell me where is it?I can find some other files with the "."prefix but those two
Comments
Comment #1
geek-merlinphp_sapi_name() gives 'cgi-fcgi' in this case.
see also #236545: 1and1 and drush.php - Fails CLI test wen using cgi php
i extended steven merrills patch like this and it works for me.
sorry i'm on vacation ;-) and cant roll a patch
in drush.php:38 replace
with
Comment #2
fgmHere is the patch.
Comment #3
moshe weitzman commentedSeems reasonable. Any comments?
Comment #4
moshe weitzman commentedCommitted
Comment #6
seanrStill doesn't work for me. Fresh checkout from head and I'm still getting the error.
Comment #7
moshe weitzman commentedComment #8
seanrFWIW, my ISP is looking into it.
Comment #9
anarcat commentedI think this is not a bug with drush per se. You should have a CLI version of PHP installed or drush will not work, simply. CGIs versions are different and unsupported.
Comment #10
ampersat commentedI was able to fix my copy of drush by changing the case of "argc" to ARGC as in:
Comment #11
ampersat commentedSpoke too soon. I was tweaking other code and forgot that I had explicitly set ARGC to a positive value. Even so, when I dump $_SERVER, ARGC is capitalized if it shows up at all. The problem I'm getting is that it seems to be completely ignoring the command line options no matter what I do.
Comment #12
greg.1.anderson commentedPresume this turned out to not be a drush issue. Please reopen with more information if needed.
Comment #13
thinkyhead commentedOn GoDaddy Linux shared servers, the PHP command-line installation is in /usr/local/php5. So to get Drush to work properly on these servers, it's easiest to just create an 'alias' for drush. If you have Drush installed in your home folder, for example, you can just add this line to your .bash_profile file:
alias drush='/usr/local/php5/bin/php ~/drush/drush.php --php=/usr/local/php5/bin/php'(Adjust for your particular install location.) To complete the process, log out. Next time you log into your site via SSH you'll be able to use drush.
Comment #14
greg.1.anderson commentedDon't forget to add --php=/usr/local/php5/bin/php to that alias.
Comment #15
thinkyhead commentedYep, the extra flag is needed! I've edited the entry above to show the proper alias.
Comment #16
greg.1.anderson commentedSee #946288: php.ini file differs from PHP configuration listing.
Comment #17
Ryanbach commentedI still have an issue with the drush updb command. It does not completely finish because of the error below:
Comment #18
greg.1.anderson commentedDrush is not using the same php when it calls itself as it is when you run drush from the command line. This is sometimes seen when you are running drush via an alias and your PATH is not right, or occasionally on some hosts with strange security models (e.g. GoDaddy). In general, you should make sure that the correct PHP is on your PATH, and that the 'drush' command is on your PATH and is not an alias.
If you must use an alias, you must specify a correct --php option that specifies the path to php and any PHP options that you need.
Comment #19
owen barton commentedComment #20
Vincent.R commentedHey,thinkyhead,
I use the godaddy hosting .why can't find the .bashrc or .bash_history?Could you tell me where is it?I can find some other files with the "."prefix but those two
Comment #21
malcomio commentedI was struggling to get drush working on heart internet shared hosting, until I found these instructions:
http://www.johnzavocki.com/blog/setting-ssh-drush-go-daddy-shared-hostin...
On heart internet the key was to add this alias:
alias drush="/usr/bin/php5-cli ~/drush/drush.php"Comment #22
thinkyhead commentedIf .bashrc doesn't exist, you can make it with
touch ~/.bashrc... Personally I've moved to Hostgator since then.