This is the best and recommended method to install and use drush for your drupal installation.
- It does not require any root privileges.
- It will not affect any other drupal installations
- No need install Drush globally.
Make sure you have already installed composer.
In the root of your Drupal Project run the following command to require the dependency. This command will automatically include the latest drush version for your Drupal project.
composer require drush/drush
Then use drush as like below from your project root, for example running cron via drush
php vendor/drush/bin cron
Optional step to use ‘drush’ as a simple command (Not recommended for Multi-installation of Drupal / Shared Server):
Add /vendor/bin directory to your $PATH variable.
Please follow and like us: