Install Drush on shared hosting with SSH access? I have SSH access on shared hosting and I followed this guide to install the composer: https://getcomposer.org/download/

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"


I got the composer.phar installed/downloaded into custom dir /composer/composer.phar

And it works if you run it php composer.phar.

Then I ran php composer.phar require drush/drush:7.x to install drush. And it installed in the /composer/vendor/bin.

Now, if I run php composer.phar drush I get error:

[Symfony\Component\Console\Exception\CommandNotFoundException]
  Command "drush" is not defined.


I set paths PATH=$PATH:~/composer/vendor/bin and PATH=$PATH:~/composer/

If I run just composer or drush I get The program 'composer' is currently not installed. To run 'composer' please ask your administrator to install the package 'composer'.
you can also install manually as long as you have ssh access
# get drush latest 8 version
# drush 8 works with D8, D7 and D6
# https://github.com/drush-ops/drush/releases
wget https://github.com/drush-ops/drush/releases/download/8.4.2/drush.phar

# make it executable
chmod +x drush.phar;

# move it to home directory or any other directory
mv drush.phar ~/drush;

# go to that directory
cd ~

# find out the path to the directory
pwd
# the output would look similar to this
# /home/your_user

# edit the following file 
nano .bashrc
# or 
# nano .bash_profile

# add this the end of the file
alias drush='/home/your_user/drush';

# use the alias you just setup
source ~/.bashrc;