8

Just getting my first hands-on with Drush 5.1. The stuff works and is very promising as per how modules can be installed and enabled. One question though. Where should I look for the drushrc.php file that everyone is referring to and how should I code it to set up aliases for my sites?

I did a search over my disk and found nothing except examples.aliases.drushrc.php. Also I found a couple of mysterious locations:

C:\Program Files\Drush
C:\Program Files\Propeople\Drush
C:\ProgramData\Drush
C:\ProgramData\Propeople\Drush

They surely contain vital stuff and I'm not going to touch anything, but I'm wondering if this is the correct post-installation shape.

1 Answer 1

10

First off, note that alias records go in *.aliases.drushrc.php, whereas general (global) Drush settings go in drushrc.php. You can find example.aliases.drushrc.php and example.drushrc.php in the Drush "examples" folder. Drush will look for aliases.drushrc.php and drushrc.php in the ".drush" folder in your home directory. On most of my systems (Linux), my home directory is /home/ga; on Linux, $HOME and ~ will expand to your home directory. On my Windows system, my home directory is at 'c:/Users/Greg Anderson'. To find out exactly where Drush thinks your home directory is, run:

drush ev 'print(drush_server_home());'

Create a .drush folder inside of your home directory, copy example.drushrc.php to .drush/drushrc.php, and example.aliases.drushrc.php to .drush/aliases.drushrc.php, and customize to suit.

1
  • Haha :) yet another pair of location :) OK, thanks Greg, the evaluation probably fails, as I'm getting empty line and a blinking prompt, but placing a simple php file named aliases.drushrc.php in C:\Users\[username] worked. Issuing drush @aliasname status returned a meaningful info. Brilliant. More questions still to come :) Commented Jul 27, 2012 at 22:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.