Using Drupal Console in Windows
- English
- 繁體中文
DrupalConsole is a CLI command tool exclusive for Drupal 8 development to generate boilerplate code, interact with and debug Drupal.
It requires running under a php environment and bash shell, which needs additional efforts to use DrupalConsole in Windows, as well as the popular Drush command. Our senior Drupal developer, Tokimeki[1], made a portable application package including the AMP stack, Drupal 8 and the DrupalConsole.
Follwing this article, you can quickly have a DrupalConsole development environment all set in your computer.
Installation
Requirements
-
Requires BASH emulator to run command, ex. Git BASH from Git for Windows[2]
-
None of WAMP stack like application installed, or service registered at port 80, 443 and 3306. This portable application won’t register the services.
-
Prefer OS from 64 bit Windows 7+; Compatible to WIndows XP+,
Step by steps
-
Download Portable APM (v8.1.7)
-
Extract file to C:\@site[3]
-
Start APM Express by executing apmxe.exe inside the folder.
-
Apache and MySQL will be start immediately.
-
You’ll get an icon in taskbar that shows the status of the services.
-
Start the Application
Your Drupal environment is now started after you execute the APM Express. Now you are able to open the pre-installed Drupal 8 and execute CLI commands.
Drupal Site
-
Your Drupal site is now running at http://localhost
-
You can login with default account & password:
-
Username: root
-
Password: localhost
-
-
To access your database, access the phpMyAdmin at http://localhost/~phpMyAdmin
Start the BASH console
DrupalConsole is a CLI tool, it requires a BASH console to run bash script. This package provide a console tool for you to start using DrupalConsole as well as Drush.
Executing console.cmd will open the command line console.
Screenshot of drupal command
> drupal |
Screenshot of drush command
> drush status |
Execute DrupalConsole
You don’t need to install the DrupalConsole, it’s already installed in the package.
Simply start with the initialize command to copy configuration files to user home directory, and it’s all set to start using DrupalConsole to build your application. For more information about houw to use DrupalConsole, please visit drupalconsole.com, you'll find all the information there.
Screenshot of drupal init command
> drupal init |
References
-
Tokimeki (d.o. agrozyme) http://drupal.org/u/agrozyme
-
You can also use Cygwin, win-bash
-
The path may have issue of Escape sequences in Windows since Windows point the folder with \ back-slash. If you want to use another folder, make sure it doesn’t cause the Escape Sequences.