使用 Drupal 控制台安装 Drupal 8

Drupal 控制台

Drupal 的新 CLI。一种生成样板代码,与 Drupal 交互并调试 Drupal 的工具。

首先,我们需要安装 Drupal Console。

Drupal Console 不仅需要这个时间,还需要将来的安装。

# Run this in your terminal to get the latest project version:
curl https://drupalconsole.com/installer -L -o drupal.phar

# Or if you don't have curl:
php -r "readfile('https://drupalconsole.com/installer');" > drupal.phar

# Accessing from anywhere on your system:
mv drupal.phar /usr/local/bin/drupal

# Apply executable permissions on the downloaded file:
chmod +x /usr/local/bin/drupal

# Copy configuration files to user home directory:
drupal init --override

# Check and validate system requirements
drupal check

你可以调用 drupal list 查​​看所有可用命令。

在下一步我们将下载 Drupal 源代码

drupal site:new

控制台将提示你选择要下载 Drupal 的文件夹。在下一步,你将被要求选择下载 Drupal 版本。我建议选择最后一个。

因此,当下载 Drupal 时,你需要安装它。

drupal site:install

经过几个简单的步骤,你的 Drupal 站点就可以了。

使用这种方法,Drupal 全新安装从命令行开始需要 5 到 7 分钟。