I’ve had to search for setting this up so many times I figure I should write my own howto on setting up drush on 1and1 hosting packages. Because 1and1 only has php-cgi and not php-cli we will have to force the drush.php file to behave differently.
NOTE: This only works on 1and1 packages with ssh.
- First you will have to create a .profile file under your home directory with these contents:
alias drush='/usr/local/bin/php5 ~/drush/drush.php'
export COLUMNS - Download drush to your home directory if you already haven’t.
- Then you will have to add this to the top of the drush/drush.php file after the first < ?php:
if (!defined('STDIN'))
{
define('STDIN', fopen('php://stdin', 'r'));
}
if (!defined('STDOUT'))
{
define('STDOUT', fopen('php://stdout', 'w'));
}
if (!defined('STDERR'))
{
define('STDERR', fopen('php://stderr', 'w'));
}That should be it.
References: