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=composer
If 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"' >> ~/.bashrc
A safer alternative to
composer global require
composer global require consolidation/cgr
Install Drush 8.
cgr drush/drush:8.x-dev --prefer-source
You should see your version of drush along with some other data if everything is working.
Using this method will help resolve the common error: count(): Parameter must be an array or an object that implements Countable Table.php:789