[SOLVED][HOWTO] How to install Drush via PHP PEAR on your cPanel/WHM shared hosting server account

With SSH enabled, Drush is one of the best command-line tools that a Drupal developer/admin can have.

If you havent heard of Drush, checkout these pages to know more about it, and about how it can help make your life much saner:
https://github.com/drush-ops/drush#description
http://drush.ws/about

Here is how you can install Drush on your cPanel/WHM shared hosting account:

Pre-requisites (ask your hosting provider to get these enabled for your account): SSH access, PHP PEAR

Now, follow the steps in this article:
http://www.coolestguidesontheplanet.com/downtown/install-drush-pear-cpan...

This should install drush for you using the PEAR packages.

Next, see whether you are seeing the following error message when invoking drush (by typing the command "drush"):

[~]# drush
exec() has been disabled for security reasons bootstrap.inc:638      [warning]
The following restricted PHP modes have non-empty values:                [error]
disable_functions. This configuration is incompatible with drush. 
Please check your configuration settings in /usr/local/lib/php.ini or
in your drush.ini file; see examples/example.drush.ini for details.
exec() has been disabled for security reasons exec.inc:150             [warning]
exec() has been disabled for security reasons exec.inc:150             [warning]
exec() has been disabled for security reasons exec.inc:150             [warning]
unlink(/home/XXXX/php/drush/lib/package.xml): No such file or      [warning]
directory drush.inc:691
The drush command 'help' could not be found.  Run `drush cache-clear     [error]
drush` to clear the commandfile cache if you have installed new
extensions.
Drush needs a copy of the PEAR Console_Table library in order to         [error]
function, and the attempt to download this file automatically failed.
To continue you will need to download the 1.1.3 package from
http://pear.php.net/package/Console_Table, extract it into
/home/XXXX/php/drush/lib directory, such that Table.php exists at
/home/XXXX/php/drush/lib/Console_Table-1.1.3/Table.php.

If you are seeing the above error, you can fix this using a custom php.ini file, as mentioned here:
http://www.6by9.net/drush-on-an-hosting-fix-using-custom-php-ini/

Once that is done, Drush should work fine for you.

Happy Drupaling!!!

P.S.: I got this working on my NixWinD Linux hosting account. But being quite generic, these steps should work fine for most other cPanel configurations. Let me know if you face any difficulty following these instructions on your account. I would be happy to help you out. :-)

Add new comment

randomness