-
安装 composer
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin
-
composer 不建议用 root 用户,新建用户并授权
useradd -d /home/ng -m ng passwd ng usermod -s /bin/bash ng chown -R ng /var/www/*
-
建库
CREATE DATABASE example_database DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; GRANT ALL ON example_database.* TO 'example_user'@'localhost' IDENTIFIED BY 'pwd';
-
下载 drupal 源码
composer create-project drupal-composer/drupal-project:8.x-dev jetdrupal.com --no-interaction --no-dev
-
安装, 新版本需要在上级目录新建这两个文件夹
mkdir -p config/sync
-
安装 drush
composer require drush/drush
(https://github.com/drush-ops/drush-launcher)
-
升级
sql-dump --result-file=../db.sql
drush pm:security
composer update drupal/core webflo/drupal-core-require-dev --with-dependencies
composer update drupal/modulename --with-dependencies
drush updatedb
drush cr