Upgrading Drush to 7 on Windows 7 and VPS

Upgrading Drush to 7 on Windows 7 and VPS

WINDOWS 7:

Installed composer first which now handles the download of Drush and puts it in C:/Users/John/AppData/Roaming/Composer/vendor/drush/drush. I uninstalled the Drush 6 version with the Windows Control Panel program removal.

Lastly I updated the Windows PATH environment variables by appending C:\Users\John\AppData\Roaming\Composer\vendor\drush\drush; to the end. That was so Drush could be accessed in each sites web root directory.

KNOWNHOST VPS:

Note: To use composer here it called for enabling "proc_open" and "exec" on the server which I did via WHM. This might need to be disabled when not in use.

First I installed Composer globally which worked fine. I am doing this all through SSH logged in as root. I can now access with the command composer anywhere.

Now I needed to install drush so that it would work for each site on the VPS logged in as the local user at /home/username/public_html. Doing them all as logged in as root causes ownership problems down the line. Here is what finally worked installing drush via SSH logged in as root.

  • cd  /usr/local/share and use wget https://github.com/drush-ops/drush/archive/master.zip to download drush from github.
  • Do unzip master and rename the containig folder "drush".
  • cd drush and run composer install.
  • Create a symlink in a folder that's in PATH which can be seen with echo $PATH.
  • Created symlink: ln -s /usr/local/share/drush/drush /usr/local/bin/drush

Other locations for drush and the symlink would work, but putting drush in /root/.composer like suggested elsewhere would not give me access to drush on all the accounts on my VPS.

This works for drush 8.0.2 as of 02/03/2016.

Also see: Unix Commands Used For Drush 7 Install.