How to Install Drush 8 on Ubuntu 18.04 (LTS)
Posted March 19, 2020 in Tech
The quick and dirty installation process
Install composer if you haven’t already.
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composerIf you haven’t already, be sure to add composer/vendor/bin to your PATH
This may be different on your system. This however was the path I had to include on my Ubuntu 18.04 (LTS) install.
echo '' >> ~/.bashrc
echo '# Include Composer Installs in PATH' >> ~/.bashrc
echo 'export PATH="$HOME/.config/composer/vendor/bin:$PATH"' >> ~/.bashrcInstall cgr
A safer alternative to composer global require
composer global require consolidation/cgrInstall Drush 8.
cgr drush/drush:8.x-dev --prefer-sourceFinally, test!
drush statusYou should see your version of drush along with some other data if everything is working.
Notes
Using this method will help resolve the common error: count(): Parameter must be an array or an object that implements Countable Table.php:789