How do you get to your server's command line? The first thing to know is that sometimes you can't. Some Web hosting companies refuse to give you access. Use a company like A2Hosting that I use. Then you can use a program like PuTTY to give you shell (SSH) access. What is SSH? Technically, SSH allows you to control another computer (ie, your web server) over the Internet through a command line interface (CLI). PuTTY is a SSH shell that will allow you to access your web server directly from your computer. If you know how to use the DOS command line shell or Windows PowerShell, you should have no problem getting used to PuTTY and drush. From Drupal: A beginner's guide to Drush we quote:
If you get errors connecting to your web site using PuTTY, the reason may be:Typical Drupal sites use dozens of modules. Each one is a separate project, with its own programmers working at their own pace. Hardly a month will go by without updates to some of the modules on your site.
Updating modules isn't hard, but it takes time. Worse, it's easy to make mistakes.
Sometimes you need to update Drupal core. Updating core is a bit stressful. You can do major damage to your site if you're not careful.
Drush can help. Drush is software that makes updating Drupal sites easier. When you tell Drush to update a module, it takes care of downloading the right version of the module, copying the files to the right place, and making database changes.
Even better, Drush can update core with a single command. W00f!
- That your hoster refuses to give you access.
- Don't write your site name correctly. Note that it shall have the format: example.com.
- You may use a wrong port.
- Other issues.
Code: Select all
cd ~
Code: Select all
pwd
Code: Select all
cd /home/username/public_html/addondomain.com
Code: Select all
cd /public_html/addondomain.com
or are unable to use PuTTY, you shall contact your hoster. When everything is Ok, you can install drupal drush.No such file or directory
For additional informatio see: Drupal: A beginner's guide to Drush. That article, tells you to install drush outside your home directory. If you are on a shared server, most probably you will get an error like this:
Code: Select all
-bash-3.2$ mkdir drush
mkdir: cannot create directory `drush':[b] Permission denied[/b]
.htaccess
Code: Select all
#Restric access to your own ip.
order deny,allow
deny from all
allow from your own Ip
.bashrc
Code: Select all
#Set the drush alias
alias drush='/home/username/public_html/drush/drush'
Code: Select all
source .bashrc
Code: Select all
drush help
Code: Select all
drush pm-update wysiwyg
One more example. I got an email with the following message:No code updates available.
When I go to the reports page in the administration panel of my site and click on on the updates link I find thatThere are updates available for one or more of your modules or themes. To
ensure the proper functioning of your site, you should update as soon as
possible.
Then I have to use the name as it is in the URL: drupal.org/project/twitter so it is twitter and not Twitter. The following command:Twitter 7.x-5.4 Update available
Recommended version: 7.x-5.5 (2013-Feb-25)
Code: Select all
-bash-3.2$ drush pm-update twitter
Hitting y gives the following output:Checking available update data ... [ok]
Update information last refreshed: Sat, 03/02/2013 - 17:09
Update status information on all installed and enabled Drupal projects:
Name Installed version Proposed version Status
Drupal 7.20 7.20 Up to date
Chaos tools (ctools) 7.x-1.2 7.x-1.2 Up to date
CKEditor (ckeditor) 7.x-1.12 7.x-1.12 Up to date
Devel (devel) 7.x-1.3 7.x-1.3 Up to date
oauth 7.x-3.1 7.x-3.1 Up to date
Twitter (twitter) 7.x-5.4 7.x-5.5 Update available
Views (views) 7.x-3.5 7.x-3.5 Up to date
Code updates will be made to the following projects: Twitter [twitter-7.x-5.5]
Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue with the update process? (y/n):
Now there are no available update in the Reports page on my drupal site, so drush functions as it shall. You find a list of drush commands on the drush site http://www.drush.org/Project twitter was updated successfully. Installed version is now 7.x-5.5.
................................................................................................
No database updates required [success]
Finished performing updates. [ok]
-bash-3.2$
Additional information to the above article: Note that there is a Drush Windows Installer
If you read the installation guide you find this information:
For more information on cwRsync see: Litterature: http://www.packtpub.com/drush-drupal-co ... guide/bookcwRsync Optional Components
This feature installs cwRsync in folder %ProgramFiles%\Propeople\Drush\cwRsync. It adds support for rsync command that is used for remote command invocation when Windows calls Linux/Unix server.