I use two shared hosts at present. One, webhostinghub.com, already has drush installed and it works. The other, 1and1.com, did not come with drush pre-installed so I installed composer and then drush with composer as recommended on drupal.org.
This puts a symlink to drush in
~/.composer/vendor/bin which points to
../drush/drush/drush. In the
~/.composer/vendor/drush/drush folder that this points to is a file drush which requires drush.php which is in the same folder.
So as recommended, I set up an alias for drush that runs this with php-cli. Because 1and1.com sets up php and php-cli to default to php4, I also set up an alias for both php and php-cli to the php7.1 versions.
When I go to the root folder of one of my drupal sites and type in simply drush, I get the non Drupal specific commands listed and then the message:
NOTE: Drupal root not found. Pass --root or a @siteAlias in order to see Drupal-specific commands.
I did see some posts saying that for this to work you have to just have one
settings.php in the
sites/default folder of the drupal tree. I have searched and have not found any stray settings.php files - just the one in the
Does any one have an idea about why this is not working? Let me know if you need more information about my setup or the process that I went through.