15/01/2016

Drush 8 Unable to untar

Error

You receive error when trying update Drupal 8 in command line with Drush 8

Unable to untar /tmp/file/path/drupal_file.tmp

Solution

Download bsdtar.exe and copy to bin folder in GnuWin32 or Cygwin.

Dont forget put something like
C:\cygwin64\bin
or
C:\Program Files (x86)\gnuwin32\bin
in your System path variable.

Test

Open new Command Prompt and write:

bsdtar

Drupal 8 error: Failed to get available update data

Update error / problem

You get errors in:
Home > Administration > Available updates

  • Failed to get available update data.
  • Failed to get available update data for 3 projects.
  • Failed to check available update data for Bootstrap.

You get Error Message in:
Home > Administration > Reports > Recent log messages 

  • GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in GuzzleHttp\Handler\CurlFactory::createRejection() (line 187 of C:\xampp\www\drupal8\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php).

 Solution

  • Copy the entire file  http://curl.haxx.se/ca/cacert.pem
    and save it in for example at "C:\xampp\php\cacert.pem"
  • Then in your php.ini file insert or edit the following line:
    curl.cainfo="C:\xampp\php\cacert.pem"
  • Restart Apache



14/01/2016

Install gnuwin32


Download GetGnuWin32

Download GetGnuWin32-x.x.x.exe from getgnuwin32.sourceforge.net

Install GetGnuWin32

  • Install GetGnuWin32-x.x.x.exe in your download temp folder.
  • Run download.bat
  • Run install.bat
Then in the directory GetGnuWin32 can find gnuwin32 directory

Setup gnuwin32

  • Copy gnuwin32 directory to C:\Program Files (x86)
  • Run C:\Program Files (x86)\gnuwin32\update-links.bat
  • Add C:\Program Files (x86)\gnuwin32 to System path
  • After that, you do not need directory GetGnuWin32 nor GetGnuWin32-x.x.x.exe so you can delete them

Test gnuwin32

Open new Command Prompt, and write for example:
wget --help

Switch Drush versions with Composer

If you already installed Drupal over Composer, you can:

Switch to Drush version 8.0.2

composer global require drush/drush:8.0.2 symfony/yaml:v2.7.8

Switch to Drush version 7.1.0

composer global require drush/drush:7.1.0

Installing Drush on Windows with Composer

Install Composer for Windows

Let's start out by install Composer for Windows.
  • Go to getcomposer.org/download
  • Scroll down and click on "Composer-Setup.exe"
  • Save the file, or just click "Run"
  • Click "Next"
  • Click "Next"

Now, we need to tell Composer where php is installed. This will be different based on whether you're using Wamp, Xampp, etc. I have Wamp installed so mine is at: C:\wamp\bin\php\php5.5.12\php.exe
  • Browse to C:\wamp\bin\php\php5.5.12\php.exe
  • Click "Next"
  • Click "Install"
  • Click "Next"
  • Click "Finish"

Install Drush via Composer

In CMD type

composer global require drush/drush:7.*

Note: if you recive wget error, you need install GnuWin32 or Cygwin.

Adding Drush Folder to the System Path

  • In the "System variables" section scroll down and click on "Path"
  • Click Edit (Each location is separated by a semicolon (;).)
  • Scroll to the end of the line, add a semicolon, and paste the path there

C:/Users/[your username]/AppData/Roaming/Composer/vendor/drush/drush

(Replace "[your username]" with your user name)

Test

Open new Command Prompt and write:

composer --version