Two ways to installing drush
1. Globally
2. Root directory Globally
Step 1: Download the composer Install the latest version.
and also we have to use
Install Composer
On Windows, you can use the Composer Windows Installer.
Step 2: Check composer version use command:- composer -v
Step 3: Now install drush globally latest version throw composer
composer global require drush/drush:8.*
Step 4: Now run the command :- composer global require drush/drush --no-update
Step 5: Now run command like. composer global update --with-dependencies
Step 6: check drush version command :- drush version
Root directory
Step 1: In most cases it's best to install Drush as a development dependency. From the root directory of your project run the following command:
composer require --dev drush/drush.
Once that's completed run the command
Step 2: Now we have to check drush is working or not.
From the root directory of your project run the following command:
./vendor/bin/drush --version
./vendor/bin/drush cr
$ drush cr
ReplyDeleteXdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port).
PHP Fatal error: Declaration of Drush\Symfony\DrushArgvInput::getFirstArgument() must be compatible with Symfony\Component\Console\Input\ArgvInput::getFirstArgument(): ?string in C:\Users\lenovo\AppData\Roaming\Composer\vendor\drush\drush\src\Symfony\DrushArgvInput.php on line 267
Fatal error: Declaration of Drush\Symfony\DrushArgvInput::getFirstArgument() must be compatible with Symfony\Component\Console\Input\ArgvInput::getFirstArgument(): ?string in C:\Users\lenovo\AppData\Roaming\Composer\vendor\drush\drush\src\Symfony\DrushArgvInput.php on line 267
Solution:- Run the command
$ composer require --dev drush/drush
After
$ vendor/bin/drush --version
$ drush