6

How do I install/setup Drupal Console on Windows 7? In the video by the author, the environment used is Linux.

I tried to install it on Windows 7, but I wasn't able to use it to generate a module code.

4
  • I have no idea what your question is. I have no idea what "Drupal 8 console" is. If you want run a server and drupal on windows 7, the easiest way might be to install "wampsever", add the drupal files to the www directory. That is how I have been doing it the past few years, until I started running a virtual machine. Commented Dec 26, 2014 at 9:35
  • Console project is available at drupal.org/project/console project help in creating modules very fast. But I am not getting it worked on windows. Commented Dec 29, 2014 at 4:38
  • Oh, well maybe do what I do and run a virtual linux server on your machine. I use virtualBox Commented Dec 29, 2014 at 9:52
  • I have answered this drupal.stackexchange please visit [Install Drupal console on windows in 3 steps ](drupal.stackexchange.com/questions/221210/…) Commented Jan 18, 2018 at 3:58

7 Answers 7

3

You can download the drupal console either using Git Bash

$curl https://drupalconsole.com/installer -L -o drupal

Or using windows command prompt

c:\>php -r "readfile('https://drupalconsole.com/installer');" > drupal

After downloading this file, place it beside php.exe file within your php folder (not project folder), restart your terminal/cmd-prompt and type

$drupal

to get started.

Besides downloading Drupal Console .phar file, you can also install Drupal Console using composer on windows.

First Download and install composer in your system.

Then on your windows command prompt or git terminal

$composer global require drupal/console:@stable
Sign up to request clarification or add additional context in comments.

Comments

2

Create a file called drupal.bat

@php "%~dp0drupal.phar" %*

Comments

2

Here's the full list of steps I took:

  • php -r "readfile('https://drupalconsole.com/installer');" > drupal.phar
  • added installation location to the global PATH
  • created a drupal.bat file in the same directory as drupal.phar. drupal.bat contains: @php "%~dp0drupal.phar" %*

Now you can call >drupal from any location. I would upvote @Nate's answer, but this is a new account.

Comments

1
  • Open Git bash (or any terminal with curl capability)
  • Run curl https://drupalconsole.com/installer -L -o drupal.phar
  • Create file drupal.bat with content @php "%~dp0drupal.phar" %*
  • Copy both files (drupal.phar and drupal.bat) into C:\WINDOWS
  • Open new Command prompt window then try typing drupal list.

This steps assume:

  • Your PHP is on Path environment variables and you can run php --version.
  • You have Git for Windows installed.

Comments

1

you can install drupal console using composer

open the command line on windows then go to :

cd /path/to/drupal8.dev

now you can install drupal console :

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

after that you installed drupal console you can use it from drupal root directory where composer.json exist as follow:

vendor/bin/drupal <the_command>

you should replace <the_command> with one of the drupal console commands. you can see complete list of the commands here: drupal console commands

Comments

0
  • Find a php.exe
  • Add this path to the environnement variable path
  • from terminal run

    php -r "readfile('https://drupalconsole.com/installer');" > drupal.phar
    
  • i then use php-storm IDE :

  • file/settings/command line

  • add tool based on symfony console
  • fill php path and drupal.phar path
  • console is now set
  • tools/run command

    drupal list 
    

Comments

0

if you have php and composer all setup make sure you're in your drupal root folder..open powershell (anyother cli) and do '

composer require drupal/console

'after this add. 'C:\<path to your drupalwebsite root folder>\vendor\bin' to your paths Environment variables

and you have composer installed: Remember to install and add composer to path variables for every local drupal installation.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.