Tag Archives: drush

Setting up php-cli for drush on Hostgator

While using Drush on a client’s website I noticed that it was showing up headers when it shouldn’t be. It was showing ugly things like this:

Set-Cookie: SESSc21f969b5f03d33d43e04f8f136e7682=d4735ec22fbf70b7d55bc7bd80691ad4; expires=Sun, 02-Mar-2014 18:44:47 GMT; path=/
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Fri, 07 Feb 2014 15:11:27 GMT
Cache-Control: store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Content-Type: text/html; charset=utf-8

A little investigation showed that drush was running as with php CGI rather than CLI. It was a simple matter to find out the path to the PHP CLI and then to modify the alias to Drush and PHP in the .bashrc file (alternatively, you may have specified it in the .bash_profile or in .profile). So here’s what you SHOULD use:

export COLUMNS
alias drush='/usr/bin/php-cli ~/public_html/drush/drush.php'
alias php='/usr/bin/php-cli'

Drupal: Installing multiple contrib modules – the easier than ‘easiest’ way

A while ago, I wrote about un-TARing multiple files in one go on the server to install multiple contrib modules for Drupal.

Of course, it seemed like the easiest thing in the world back then… But then, in 2010, the world still had Kodak films in production.

Now, allow me to show you the truly simplest way to install a drupal and add contrib modules – Drush. Of course, Drush allows for even more automation, but this workflow is quite sufficient for me at this time. It’s quite simple to install Drush on a Dreamhost Shared account with SSH.

Target folder – home/coloursalive.com

  1. cd
    to the level above the target folder
  2. wget http://ftp.drupal.org/files/projects/drupal-7.14.tar.gz
  3. ls
    confirm that the file has downloaded
  4. tar -xzvf drupal-7.14.tar.gz
    a new folder called drupal-7.14 is created
  5. check that there are no files that are required in the target folder
    1. Copy / Backup any files that are needed from the target folder
    2. delete the target folder and all subfolders
      rm -R coloursalive.com
  6. navigate to target folder in browser (in this instance www.coloursalive.com) and follow instructions to install drupal
  7. come back to shell once basic install is completed
  8. Download most basic modules
    drush dl token pathauto ctools views admin_menu wysiwyg imce webform libraries jquery_update views_slideshow imce_wysiwyg devel entity rules page_title
  9. Enable the modules that have been downloaded. In some instances additional modules that make up the project are downloaded. Assess the necessary modules to be enabled and enable them.
    drush en token pathauto ctools views views_ui admin_menu_toolbar admin_devel admin_menu wysiwyg imce webform libraries jquery_update views_slideshow views_slideshow_cycle imce_wysiwyg devel entity rules rules_admin page_title
  10. Ensure OK / success messages on all modules
  11. Move over to the admin section of the website and continue setting up the install

I’ll be happy to hear from you if you have any suggestions. Leave them in the comments, please.