Drupal 8 – How to get Drush to run on a Linux distro

Blaine's picture
Drush is very popular in the Drupal community because it bypasses the GUI completely. Drush is a CLI tool making developing time a breeze. | Install Drush

Getting Drush to work in Linux for Drupal

Now that Drush has removed support for Pear, and running the drush.php manually is currently not working, you are “forced” to use Composer.

If you don’t follow this way, you will get an error like:
Unable to load autoload.php. Drush now requires Composer in order to install its depedencies and autoload classes. Please see README.md

If you do not currently have composer installed you will need to download and install it, see https://getcomposer.org/doc/00-intro.md for instructions.

You will need to run the following:

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

Now we will set the path to .composer:

sed -i '1i export PATH="$HOME/.composer/vendor/bin:$PATH"' $HOME/.bashrc
Now to work with Drupal 8, you will require the latest Drush (7.x) at the time of writing this, which you can install like:

EDIT: 9/4/17 This code will pull in drush 9.x.dev
~/composer.phar global require drush/drush:dev-master --prefer-source && source ~/.bashrc

To update drush (as Drush is usually updated several times a day), simply run:

cd ~/.composer
~/composer.phar update

Recent Posts

Video Marketing for Business: Here is what the experts are saying If you are an entrepreneur in this era, you... Read more
Brand Yourself for Web Marketing It's time to talk about the feature that will set you apart from your competition... Read more
Time to Make your Presence on the Web Felt: How Much you Should invest? You know what you want to... Read more

Need Support?


Every video, every website, every chatbot, every client - 100% custom products and solutions to make your business run successfully

145 Pine Haven Shores Road #1205 Shelburne, VT

Recent Tweets

  • This needs to end... Senseless violence all for what? https://t.co/mNMP0uMnJN 1 week 6 days ago
  • RT : My warmest condolences and sympathies to the victims and families of the terrible Las Vegas shooting. God bless you! 1 week 6 days ago
  • RT : Michelle & I are praying for the victims in Las Vegas. Our thoughts are with their families & everyone enduring another senseless tragedy. 1 week 6 days ago
  • RT : Las Vegas update: - At least 400 wounded taken to hospitals, per police - Gunman found dead in hotel room https://t.co/5EOndn2tkj 1 week 6 days ago
  • RT : Keep us in your thoughts - its a very difficult and tragic evening for a lot of people ,… https://t.co/mf7x29rD9Y 1 week 6 days ago

Socialize with us

               


Go to top