2.14.5.8. Install Drush

Drush is a command-line utility for quick access to the Drupal core. It is installed using Composer.
  1. Connect to the hosting via SSH.
  2. Set the PHP version for the console that matches the required version of Drush (see Drupal compatibility).
  3. Install Drush (replace 13.* with the required Drush version, and php83 with the PHP version that corresponds to the required Drush version):
    mkdir ~/drush && cd ~/drush
    composer require drush/drush:13.*
    echo "alias drush='/usr/local/php83/bin/php ~/drush/vendor/bin/drush' " >> ~/.bashrc && source ~/.bash_profile
  4. Check the installed version of Drush:
    drush --version

The installed Drush can be run in the console with the command drush.

目录

    (1)