I am using drush 3 on my Mac, and site aliases are working fine (love 'em).

I have a similar setup on my Window (7 Ultimate) box, using cygwin for a 'nix shell and Xampp (1.6.8) for a LAMP stack. I have an alias in my .bashrc to point to the drush executable:

alias drush="/cygdrive/p/drush/drush"

I've also tried adding a path to php in the alias, no help (it is in 'usr/local/bin)

Everything is working, except for site aliases. If I type the command

drush sa

nothing comes up, but on the Mac I see a list of the aliases in my aliases.drushrc.php

I'm suspecting it is a cygwin config issue, because whenever I issue a drush command, the first thing I see is

#!/usr/bin/env php

before any other output. I've searched the issue queue and Google for tips on how to configure drush with cygwin but haven't seen any solid tutorials. There were some recent issues and patches, but they seem to all be resolved in the version 3 release.

I also tried the alias in Morten's for Mac tutorial on cygwin:

alias drush="/cygdrive/p/Xampp/php/php.exe /cygdrive/p/drush/drush.php"

but I get the error "Could not open input file: /cygdrive/p/drush/drush.php", even though the file is there:

# ls -l /cygdrive/p/drush/drush.php
-rwxrwxr-x+ 1 Administrators None 7329 2010-04-28 09:25 /cygdrive/p/drush/drush.php

If anyone has a guide on cygwin and drush, I'd appreciate seeing it. I'm assuming that I don't need to use the drush.bat method because cycgwin is more unix than windows, right?

Comments

greg.1.anderson’s picture

I've used cygwin a lot, but never with php or drush. So, my first question is, can you set up a drushrc.php file at some standard location, such as $HOME/.drush/drushrc.php or /etc/drush/drushrc.php, and have it take effect? (The path to your rc file will appear in the output of drush status). If so, you could explicitly set:

$options['alias-path'] = '/path/to/where/I/keep/my/aliases';

Then drush sa should work. I'm not sure why your seeing the #!/usr/bin/env php line, but you could try using the drush wrapper script instead.

One possible source to your problems is that maybe once you begin executing php, then you are no longer in the cygwin environment, and paths such as "/cygdrive/..." are no longer available. I'd recommend specifying all of your drush paths Windows-style, and see if that takes you farther.

pglatz’s picture

Thanks for the suggestions, Greg. I finally got it to work, by adding this to ~/.drush/drushrc.php:

$options['alias-path'] = 'c:\\cygwin\\home\\phil\\.drush';

And I got rid of the "#!/usr/bin/env php" from my output by simply editing drush.php and removing it; it works fine now without it.

greg.1.anderson’s picture

Status: Active » Fixed

Glad to hear that cleared things up.

pglatz’s picture

Status: Fixed » Closed (fixed)
mooru’s picture

Component: Installation » PM (dl, en, up ...)

I got drush to work with cygwin by adding aliases and putting the drush folder in usr/local/bin but when i try to run the command drush help it gives this error

Fatal error: Class 'Console_Table' not found in C:\cygwin\usr\local\bin\drush\includes\drush.inc on line 955
Drush command could not be completed.

Any ideas show to fix this