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.
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.
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
Create a file called drupal.bat
@php "%~dp0drupal.phar" %*
Here's the full list of steps I took:
@php "%~dp0drupal.phar" %*
Now you can call >drupal from any location. I would upvote @Nate's answer, but this is a new account.
Git bash
(or any terminal with curl
capability)curl https://drupalconsole.com/installer -L -o drupal.phar
drupal.bat
with content @php "%~dp0drupal.phar" %*
drupal.phar
and drupal.bat
) into C:\WINDOWS
Command prompt
window then try typing drupal list
.This steps assume:
Path
environment variables and you can run php --version
.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
from terminal run
php -r "readfile('https://drupalconsole.com/installer');" > drupal.phar
i then use php-storm IDE :
file/settings/command line
tools/run command
drupal list
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.
© 2022 - 2024 — McMap. All rights reserved.