purewebmedia.biz - How to Setup Drush on Shared Hosting









Search Preview

How to Setup Drush on Shared Hosting | Pure Web Media | Web Design and Drupal CMS Web Development, Victoria BC

purewebmedia.biz
This article covers setting up Drush on shared hosting accounts, which may require some custom configuration in order to access those tools remotely.
.biz > purewebmedia.biz

SEO audit: Content analysis

Language Error! No language localisation is found.
Title How to Setup Drush on Shared Hosting | Pure Web Media | Web Design and Drupal CMS Web Development, Victoria BC
Text / HTML ratio 46 %
Frame Excellent! The website does not use iFrame solutions.
Flash Excellent! The website does not have any flash contents.
Keywords cloud Drush file ~bashrc drush   alias composer require Composer directory remote PHP global source Drupal aliases command => bashrc return
Keywords consistency
Keyword Content Title Description Headings
Drush 44
file 14
~bashrc 13
drush 12
  11
alias 10
Headings
H1 H2 H3 H4 H5 H6
1 13 2 1 0 0
Images We found 15 images on this web page.

SEO Keywords (Single)

Keyword Occurrence Density
Drush 44 2.20 %
file 14 0.70 %
~bashrc 13 0.65 %
drush 12 0.60 %
  11 0.55 %
alias 10 0.50 %
composer 9 0.45 %
require 9 0.45 %
Composer 9 0.45 %
directory 9 0.45 %
remote 7 0.35 %
PHP 7 0.35 %
global 7 0.35 %
source 6 0.30 %
Drupal 6 0.30 %
aliases 6 0.30 %
command 6 0.30 %
=> 6 0.30 %
bashrc 6 0.30 %
return 5 0.25 %

SEO Keywords (Two Word)

Keyword Occurrence Density

SEO Keywords (Three Word)

Keyword Occurrence Density Possible Spam

SEO Keywords (Four Word)

Keyword Occurrence Density Possible Spam

Internal links in - purewebmedia.biz

Services
Victoria Web Design Services | Pure Web Media | Web Design and Drupal CMS Web Development, Victoria BC
Portfolio
Web Design and Web Development Portfolio | Pure Web Media | Web Design and Drupal CMS Web Development, Victoria BC
About
Web Design and Development History | Pure Web Media | Web Design and Drupal CMS Web Development, Victoria BC
Articles
Recent Articles | Pure Web Media | Web Design and Drupal CMS Web Development, Victoria BC
Contact
Contact Us | Pure Web Media | Web Design and Drupal CMS Web Development, Victoria BC
Drupal compared to WordPress and Joomla
Drupal compared to WordPress and Joomla | Pure Web Media | Web Design and Drupal CMS Web Development, Victoria BC
Read what our customers have to say
Testimonials | Pure Web Media | Web Design and Drupal CMS Web Development, Victoria BC
contact
Contact Us | Pure Web Media | Web Design and Drupal CMS Web Development, Victoria BC
Victoria Web Development with LibSass, Node.js, Gulp
Victoria Web Development with LibSass, Node.js, Gulp | Pure Web Media | Web Design and Drupal CMS Web Development, Victoria BC
Drupal 8 CMS Has Landed
Drupal 8 CMS Has Landed | Pure Web Media | Web Design and Drupal CMS Web Development, Victoria BC
Responsive Inline Images with the Picture module and CKEditor 4
Responsive Inline Images with the Picture module and CKEditor 4 | Pure Web Media | Web Design and Drupal CMS Web Development, Victoria BC
How to Setup Drush on Shared Hosting
How to Setup Drush on Shared Hosting | Pure Web Media | Web Design and Drupal CMS Web Development, Victoria BC
next ›
Pure Web Media | Victoria Web Design and Drupal CMS Web Development

Purewebmedia.biz Spined HTML


How to Setup Drush on Shared Hosting | Pure Web Media | Web Design and Drupal CMS Web Development, Victoria BC Skip to main content ServicesPortfolioAboutHomeArticlesSupportContact Analyze Design Develop Launch How to Setup Drush on Shared Hosting Printer-friendly version Sunday, November 2, 2014 2015-10-06: Mac OS 10.11 El Capitan Note: With the new operating system, Apple has clamped lanugo on installing applications in /System, /bin, /usr (exception: /usr/local), and /sbin with the policing of the 'System Integrity Protection' measure. In some cases, using symlinks can help get your now legacy software installs of Vagrant or Drush to work. For increasingly info on these directories, see: http://pointlessramblings.com/posts/El_Capitan/. For increasingly detail on El Capitan, see Ars Technica here. This vendible is primarily well-nigh setting up Drush 8 (or others) on remote shared hosting finance which may require some custom configuration in order to wangle those tools remotely. This vendible assumes you know what Drush is but if you don't, you can read well-nigh it from Drupal.org as well as hundreds of other websites. These instructions are thesping that: you once have your public key on your remote server (required for the particular specimen of using Drush aliases) you are logged in via SSH. If you require help on setting this up, please refer to external this article. you have at least PHP 5.4.5+ since both Composer and Drush 8 require that minimum. your host is running Linux. Drush Compatibility Table - (updated: 2016-05-05) Drush Version Drush Branch PHP Compatible Drupal versionsLawmakingStatus Drush 9 master 5.5+ D7, D8 Drush 8 8.x 5.4.5+ D6, D7, D8 Drush 7 7.x 5.3.0+ D6, D7 Drush 6 6.x 5.3.0+ D6, D7 Unsupported Drush 5 5.x 5.2.0+ D6, D7 Unsupported Summary of Commands to Install Drush 8 cd ~ mkdir ~/bin flourish -sS https://getcomposer.org/installer | php -- --install-dir=bin (maybe)mv composer.phar bin/composer # Use either the PHP5 or PHP7 lawmaking unelevated but not both. For PHP5.x use: (in ~/.bashrc) plume composer="/usr/bin/php-cli ~/bin/composer.phar" # For PHP7.x use: (in ~/.bashrc) plume composer="/usr/local/bin/php ~/bin/composer.phar" source ~/.bashrc composer global require drush/drush (in ~/.bashrc) [ -z "$PS1" ] && return (in ~/.bashrc) export PATH=$PATH:~/.composer/vendor/drush/drush (in ~/.bashrc) plume drush='~/.composer/vendor/drush/drush/drush' source ~/.bashrc drush core-status Below, I'll outline what all these steps are in detail. Steps to Install Drush 7 or Drush 8 For Drush 7 and up it's prudent to use Composer which known as a 'Dependency Manager for PHP', so we're going to start with downloading it first, then moving it into a bin directory. Start by going to your home directory with: cd ~ and then creating a bin directory if one doesn't once exist with: mkdir ~/bin followed by flourish -sS https://getcomposer.org/installer | php -- --install-dir=bin. You should get a message saying something like Composer successfully installed to: /home/[your-account]/bin/composer.phar (Note: If it was instead installed in your main worth directory, create the composer directory with: mkdir ~/bin/composer and move Composer into that directory with mv composer.phar bin/composer) We next need to icon out where php-cli is on our on remote hosting worth (PHP 5.x), which you can do with the command: which php-cli. which can tell you for example that it's at /usr/bin/php-cli. For PHP 7.x, the command: which php which will likely tell you for example that PHP is located at /usr/local/bin/php. Depending on what version PHP you're running, take the result and add it into ~/.bashrc. This tells the system where to run composer commands from. Edit ~/.bashrc by subtracting this to the endPlumesection. For PHP5 you'll add: plume composer="/usr/bin/php-cli ~/bin/composer.phar". For PHP7, you'll add: plume composer="/usr/local/bin/php ~/bin/composer.phar". Save and reload the information in this file by typing: source ~/.bashrc (Note: see section 'Drush Aliases and Accessing your Remote Machine' unelevated for why we use this file and not .bash_profile) At this point, if you type: composer you should get a listing of commands, and if so, we know Composer is ready for use and to help us install Drush. To do this, type: composer global require drush/drush which should install Drush 8.1 into: ~/.composer/vendor/drush/  withal with dependencies such as console_table, yaml and possibly others Note: If you require specific versions of Drush, you could use instead: composer global require drush/drush:8.1 for Drush 8.1, which works for 6,7 or 8 as long as you meet the min php 5.4.5 requirements composer global require drush/drush:7.0.0 for Drupal 6 or 7 composer global require drush/drush:dev-master gives the default of Drush 9  In any case, Drush will be installed into your ~/.composer/vendor directory withal with its dependencies. Once that is well-constructed we need to return to our ~/.bashrc file to state where Drush is installed. Edit your ~/.bashrc file and surpassing the line [ -z "$PS1" ] && return (Add that line at the top of your file if it doesn't once exist.Increasinglyon this below), add: export PATH=$PATH:~/.composer/vendor/drush/drush. Then, in yourPlumesection, add: plume drush="~/.composer/vendor/drush/drush/drush" Now save and reload your .bashrc file with: source ~/.bashrc Now type: drush core-status and hopefully you should get output telling you vital info well-nigh your Drush install.   Here's what your .bashrc file could squint like at minimum: # .bashrc export PATH=$PATH:~/.composer/vendor/drush/drush [ -z "$PS1" ] && return # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # User specific aliases and functions plume composer="/usr/bin/php-cli ~/bin/composer.phar" # OR plume composer="/usr/local/bin/php ~/bin/composer.phar" plume drush="~/.composer/vendor/drush/drush/drush" Troubleshooting If you're using Drush 7.x and got this message while running a drush command: exec() has been disabled for security reasons bootstrap.inc:645      [warning] The pursuit restricted PHP modes have non-empty values:                [error] disable_functions. This configuration is incompatible with drush.  Please trammels your configuration settings in /usr/local/lib/php.ini or in your drush.ini file; see examples/example.drush.ini for details. ...then you may need to edit you php.ini file. Don't edit the original, but make a reprinting of it. Typically, on shared hosting, this is kept in /usr/local/lib/php.ini, so use this writ to make a reprinting of it: cp /usr/local/lib/php.ini $HOME/.drush.Then within your copied file, find the line with the disable_functions = directive and remove exec from the list of disabled function names. (Note: You may have to remove everything without the disable_functions = directive in order for Drush to work properly but contact your hosting provider to see how secure that nomination is.) Congratulations! You now have Drush running on your shared hosting. The reason Composer is going to be important is that you can use it later on lanugo the road to update Drush, so you don't have to do it manually. Drush Aliases and Accessing your Remote Machine The reason that the [ -z "$PS1" ] && return is important is considering Drush logs into your remote machine over ssh, but since it is not a normal 'interactive' login, it doesn't source the .bash_profile file. It does, however, source the .bashrc file and although the settings whilom could go into .bash_profile, they need to go into .bashrc to indulge remote connections with Drush. You can read increasingly well-nigh the differences between these two files here. Making your changes here will therefore help with accessing your remote site using Drush aliases. You need this declaration at the top of your .bashrc file to stave getting the message: stdin: is not a tty There are various ways of creating aliases, but I will focus on the most basic. Here is an example of a Drush plume for a vital local setup plus a remote site which is setup with a file tabbed aliases.drushrc.php in your local ~/.drush directory: $aliases['coolsite1.local'] = array(     'uri'  => 'local.mysite.com',         'root' => '/Users/your-username/Sites/mysite/www', ); $aliases['coolsite1.live'] = array(     'uri'  => 'http://mysite.com', 'root' => '/home/user/www/mysite', 'remote-host' => 'myisp.com', 'remote-user' => 'wwwadmin', ); Once you've cleared your local Drush enshroud with: drush cc drush, you should be worldly-wise to type both: drush @coolsite1.local status and receive the status of your local Drupal site without having to be in the Drush root directory; While you should moreover be worldly-wise to type: drush @coolsite1.live status and in a few moments, you should receive the status of your live site. Use Drush to Synchronize Live and Local Databases If everything is working as expected then, while you're on your local machine, you can harness the power of Drush to reprinting the database specified in sites/live to the database in sites/local with: drush sql-sync @coolsite.live @coolsite.local or just drush sql-sync @coolsite.live @self. Leave our the -y flag and as a safety precaution, Drush will then spell out exactly what is well-nigh to happen surpassing it continues. Get increasingly info on this writ from the Drupal Commands website. Note that you should do your weightier to use the same versions of Drush both locally and remotely, otherwise you could run into issues. See this vendible for increasingly info. Use Composer to Update Drush Besides downloading the dependencies required for various software installs, like Drush, Composer can be used to update the versions of software you installed with it by using one simple line: composer global update. It's that easy. Further resources: Using drush to synchronize and deploy sites Composer Why do I get a 'bash: drush: writ not found' message? drupal, drush Testimonials It’s so tomfool when I see what we created ranking right up there on page one of Google! Adam Brosgall read increasingly Recent Articles Victoria Web Development with LibSass, Node.js, Gulp Drupal 8 CMS Has Landed Drupal 6 Support to End in Feb 2016 Responsive Inline Images with the Picture module and CKEditor 4 How to Setup Drush on Shared Hosting 1 of 6next › read increasingly © 2018 PureWebMedia.biz Links Services PortfolioWell-nighHome Articles Support Contact Social Media facebooktwitterlinkedin Contact 308 - 1138 View St. Victoria, BC V8V 3M1 250-208-5898 info@purewebmedia.biz