I installed drupalconsole on Window 7 as follow:
1. Install XAMPP, or update XAMPP, make sure that PHP version 5.6 or above
2. add path: C:\xampp\php to window path variable (Right click on Computer, > Advanced system settings > Environment Variables > edit path)
type php --version, make sure the result version is 5.6 or above
3. create folder: c:\drupalconsole, cd to this folder on the command , and run this command:
php -r "readfile('https://drupalconsole.com/installer');" > drupal.phar

Make sure that we have file drupal.phar under folder c:\drupalconsole

4. Create drupal.bat file under this folder: c:\drupalconsole, and paste the following code to this file:

@php "%~dp0drupal.phar" %*

5. add path c:\drupalconsole to window variable path (Right click on Computer, > Advanced system settings > Environment Variables > edit path)

6. restart the window, and on the command line type: drupal list, or drupal --version

Comments

Belba’s picture

After 3 days suffering installing console, this works, thanks alot for this.

densolis’s picture

I followed the instructions, but when I run drupal --version in my development account, I get the message:

C:\Sites_A>php.exe composer.phar require drupal/console:~1.0 --prefer-dist
Could not open input file: composer.phar

C:\Sites_A\dev\bc-d8-dev>drupal --version

[ERROR] Drupal Console is not installed at: C:\Sites_A\dev\bc-d8-dev/

You must execute the following composer commands:

composer require drupal/console:~1.0 --prefer-dist
--optimize-autoloader
composer update drupal/console --with-dependencies

C:\Sites_A\dev\bc-d8-dev>drupal init

[ERROR] Drupal Console is not installed at: C:\Sites_A\dev\bc-d8-dev/

You must execute the following composer commands:

composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader
composer update drupal/console --with-dependencies

So I run the composer command
C:\Sites_A\dev\bc-d8-dev>php.exe composer.phar require drupal/console:~1.0 --pre
fer-dist --optimize-autoloader
Could not open input file: composer.phar

C:\Sites_A\dev\bc-d8-dev>

Also, one other note. If you want to rush this from git bash, the name of your "batch" file is just drupal and not drupal.bat.

Any suggestions?

Dennis

blastoise’s picture

Thanks for instructions!

srikanth.g’s picture

very easy to follow but looks confusion between composer,drush,drupal console,docker,vagrant,puppet,chef,drupalvm and cygwin...

ellosfallos’s picture

Everything works until step 6: When I open CMD and type in "drupal list" or "drupal --version" it says:

Warning: readfile(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1

Warning: readfile(https://drupalconsole.com/installer): failed to open stream: Invalid argument in Command line code on line 1

What should I do?

Eloy Ruiz’s picture

I tried with the official documentation but didn't work .
Thanks for you nice and clear explanation.

gvigroux’s picture

I foloow your instructions but I have the issue:
Fatal error: Call to undefined function Drupal\Console\Launcher\Utils\pcntl_exec() in phar://C:/Development/wamp64/drupalconsole/drupal.phar/src/Utils/Launcher.php on line 34

Any idea?