1.1 Drupal8介绍

1龵龴龱龮龫

PHP7.x

MySQL5.7.x

Apache2.4.x

齸齷齵齱齮齬齪齩齥

https://www.apachefriends.org/download.html

2龵齄齃齂齀鼾鼺鼷齷齵鼳navicat鼭鼫phpmyadmin

3龵鼥鼤鼡鼟鼞鼛鼗

Drupal鼑鼐鼎鼍鼉鼡鼇/sites/default/files鼟鼞鼄鼂鼁鼟鼞鼳黾黼黸黵黼鼥鼤(黱黰黬黪CSS鼡JS鼥鼤)鼡黡點Drupal黚黗黕黒黪鼥鼤鼄齄齃黏黎黌755黊黆黕黏黎黌555

4龵settings.php黃黎

default.setting.php黂黀麼黌settings.php黊麹黏黎鼛鼗黌755黊黆黕黏黎黌444

5龵齱齮Drupal8

Drupal8齱齮麶龮龫黃黎麳麱URL黊麦龮麤apache麠麟麛url_rewrite麘麔鼄

6龵黃黎Cron

麛鼳cron

麤鼺鼷>黃黎>麌麋>cron(admin/config/system/cron)麊黗黏黎cron鼄麉麈麄麂cron黪麶麀麀鹿鹾3鹻麶黊鹹鹶鹾鹵3鹻麶黬鹲鹰鹮鹬鹫鹩鹨鹤麶黊鹡鹟鹜cron鹘鹖鼄麤鹔鹐鹌黪鹨鹤黕麟麛cron鹾鹉鹈黪黊鹇鹅鹬鹫鹌鹄鹃鹂黊鸿黾鸼鼎鸻鸷黊鹩鸴鸳鸰鼳鸯鸬cron鹘鹖鼄

鸩鸨cron

麤鼺鼷>黃黎>麌麋>cron(admin/config/system/cron)麊黗黊鸦鸤Run cron every鸣鸠鸜黊鹡鸛黏黌Never(鸘鹉)鼄鸕鸓鹩齷齵黏黎’cron_safe_threshold’鸌鹌黪鸉黌0鸇鸩鸨鼄鹇鸣:

drush –y vset cron_safe_threshold 0

鸕鸄鸃鸩鸨cron黪鷿鷼鹾鷹鷵settings.php鼥鼤:

$conf[‘cron_safe_threshold’] = 0;

鷥鹹鼂鹡黏黎admin/config/system/cron黌Never黊麹鷡鼺鼷鷝鷙鷘鸘鼺鼷黚黗鷗鷵鼂鸄黏黎鼄

7龵PHP黏黎

黌鷔鷑Drupal鷗鸳齃鷐鷎黊麦鷋PHP.ini鷎鸄鷇黏黎:

session.cache_limiter = nocache

session.auto_start = 0

expose_php = off

allow_url_fopen = off

magic_quotes_gpc = off

register_globals = off

display_errors = on

8龵Drush齱齮

##1龵齱齮composer

鷎黌鸴鶷麼黪php鶵鶳鷿鼾齱齮鷐鶯黊drush齸鶬鶨鷑鼳鼂鸃鷿鷼齱齮鼄
composer黪齱齮鹄鹃麳鸦鼄

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/bin --filename=composer

vim ~/.bashrc 麹鶛鶗鸄鶕 export PATH=鶑$HOME/.composer/vendor/bin:$PATH鶑鼄

##2龵齱齮drush

# Create and/or navigate to a path for the single Composer Drush install.
mkdir --parents /opt/drush-8.x
cd /opt/drush-8.x
# Initialise a new Composer project that requires Drush.
composer init --require=drush/drush:8.* -n
# Configure the path Composer should use for the Drush vendor binaries.
composer config bin-dir /usr/local/bin
# Install Drush. 
composer install

齱齮鵾黊鹇鹅鹰Unable to load autoload.php…黪鹈鵻黊鵺鵷

vim /usr/local/drush/drush/drush/includes/preflight.inc

鵳鵯$global_vendor_path黊鷹鷵黌

$global_vendor_path = DRUSH_BASE_PATH . '/../vendor/autoload.php';

麄麂黀鵪

drush version

鹇鹅鵦鵢

Drush Version:  8.1.2

鵜齱齮齪鵚鼄

黌鵖鵔龮齱齮drush?鵑黌drush鹾鸄鵐鵌鵋鵇鵃黪drupal鼺鼷鷐鶯黊drupal鵂鹉麟drush鼄

9龵windows鸣齱齮黃黎drupalconsole

齄鵀鴽鴺鴷麤windows鸣黪齱齮黃黎黊linux鴶鴲鴰鴬鴫

1龵鸣鴩 drupalconsole

鹤鸤鼂麠 鸣鴩 drupalconsole 黊鷗麼 drupal

2龵鵯鼁鼟鼞鴧鴣齱鴟

鴜鹇齥 D:\system\drupalconsole 黊鹇鴗鴔鵢齥鴓鴰鴏鴋鴉鴅鴂鴀

drupalconsole-home

drupalconsole是啥

The new CLI for Drupal. A tool to generate boilerplate code, interact with and debug Drupal.

以上是官网的简介,总而言之是为drupal8而生的一个命令行工具

这里是官网

3龵黃黎龴龱鸌鹌

php.exe 鴔麤黪鼟鼞鶗鳻龴龱鸌鹌 PATH

鳷鳽黕鸄鳴 drupalconsole 黪齱鴟鼟鼞鶗鳻 windows 黪龴龱鸌鹌 PATH 鳺黊鼳鳱鼭鼫麌麋黪鳯齷齵

鹇鴗齥鴓鴰鴏鴋鴉鴅鴂鴀

system_path

4龵鳭麟 git 黪黀鵪麂鷐鶯鳪鳩鸄鸣 (鴰鴏鴋鴉鴅鴂)

drupalconsole

再插一句,貌似windows不认识非exe的可执行程序,需要安装个git的命令行工具

本书共79小节:

评论 (写第一个评论)