By JohnDoea


2016-06-22 00:25:22 8 Comments

How do you install Drush on WSL (Windows Subsystem for Linux) when the following command from Drush docs, doesn't work?

php -r "readfile('http://files.drush.org/drush.phar');" > drush

2 comments

@JohnDoea 2016-06-22 00:25:22

sudo wget http://files.drush.org/drush.phar
sudo mv drush.phar /usr/local/bin/drush
sudo chmod +x /usr/local/bin/drush
# test drush by executing:
drush status

Note_1: For possible future releases --- If there will be non-Ubuntu version of WSL you might need to download the wget Linux utility to use it for downloading drush.phar.

Note_2: To those who have yet to install WSL - See this thread.

@Yaron Meiner 2016-10-19 02:10:49

Better to follow this to require with composer: https://www.drupal.org/node/1248790

  1. Install composer globaly:

    $ curl -sS https://getcomposer.org/installer | php

    $ sudo mv composer.phar /usr/local/bin/composer

  2. Require drush:

    composer global require drush/drush:7.*

The instructions in drupal.org also show how to add the path so you can use drush from everywhere.

Im working with WSL and it works great.

Related Questions

Sponsored Content

9 Answered Questions

2 Answered Questions

[SOLVED] Is it possible to run drush 8 smoothly on Win10 WSL (Windows Subystem for Linux)?

  • 2016-05-16 23:12:21
  • JohnDoea
  • 724 View
  • 5 Score
  • 2 Answer
  • Tags:   drush

0 Answered Questions

Drush 9 on Windows 10 -- some Drush scripts not found -- but other Drush commands work

  • 2018-01-04 00:24:31
  • DonRichmond
  • 939 View
  • 1 Score
  • 0 Answer
  • Tags:   drush

2 Answered Questions

[SOLVED] Could not open input file: drush

  • 2017-07-12 23:23:52
  • Rob Brandt
  • 1177 View
  • 0 Score
  • 2 Answer
  • Tags:   drush installing

1 Answered Questions

[SOLVED] What is the most general way to install Drush?

  • 2017-03-22 12:25:01
  • JohnDoea
  • 44 View
  • -1 Score
  • 1 Answer
  • Tags:   drush

2 Answered Questions

[SOLVED] Drush 8.1.2 is not working on Windows

  • 2016-06-19 14:45:09
  • Rajesh Vishwakarma
  • 651 View
  • 1 Score
  • 2 Answer
  • Tags:   drush

1 Answered Questions

[SOLVED] Using php command to pass custom php.ini values into drush phar

  • 2016-08-30 02:28:57
  • zerorez
  • 243 View
  • 1 Score
  • 1 Answer
  • Tags:   drush

1 Answered Questions

Running drush site-install on Windows

  • 2015-12-11 03:29:10
  • Drupal 8 test
  • 176 View
  • 1 Score
  • 1 Answer
  • Tags:   drush 8 installing

0 Answered Questions

Problems installing drush 7.0 on Windows

  • 2015-10-14 09:56:30
  • Martin K
  • 67 View
  • 0 Score
  • 0 Answer
  • Tags:   drush

Sponsored Content