18.11.2015 Views

Beginning Drupal 8

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 15<br />

Using Drush<br />

This chapter provides a basic overview of Drush, a command-line tool that greatly simplifies the tasks of<br />

building and administering a <strong>Drupal</strong> 8 website. With Drush, tasks that often require logging onto your<br />

site, navigating to a site administration page, and filling out a form can now be performed with a simple<br />

command-line interface. Drush also enables you to administer one or several sites remotely, without having<br />

to log onto each server and each site to perform routine maintenance tasks. Drush handles most of the<br />

tasks associated with managing modules, themes, and user profiles and common administrative tasks like<br />

running cron, creating backups, and clearing caches. You can even execute SQL command from Drush.<br />

Installing Drush<br />

Drush is at its core a set of shell scripts (Unix/Linux) or bat scripts (Windows), combined with PHP scripts<br />

that handle most of the common tasks of administering a <strong>Drupal</strong> site. Installing the scripts and PHP is a<br />

relatively straightforward process on both Unix/Linux and Windows.<br />

Installing Drush on Unix, Linux, or OS X<br />

To install Drush on Unix, Linux, or OS X, follow these steps:<br />

1. Download Drush from https://github.com/drush-ops/drush. In the right<br />

column of the Drush landing page on GitHub, you will see a Download ZIP<br />

button. If you are familiar with Git (see Chapter 16), you may wish to clone the<br />

Git repository so that updates to Drush are easier to manage. For information on<br />

cloning repositories, see Chapter 16.<br />

2. Place the uncompressed drush.zip file in a directory that is outside of your web<br />

root. On most web servers, the webroot will be something like public_html or<br />

www_root or docroot. Review your web server’s documentation for details on<br />

where the web root directory resides. For security purposes, you don’t want to<br />

place it in your web root, as it would then be available and executable by anyone.<br />

3. Make the drush command executable:<br />

$ chmod u+x /path/to/drush/drush<br />

169

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!