Drupal 安装 amp 安装问题回顾:安装amp可能会遇到的问题及解决办法
本地测试环境
1.必备:cms程序源码、数据库文件
2.服务器环境模拟:官方推荐
3.安装失败可能性:windos下安装失败可能是缺少.net或 c++ 组件,也可能是版本不兼容操作系统的问题
4.必要管理组件:composer、git(官网下载windos版本)
5.composer本地下载官方的exe文件放到cms目录下运行下载,并执行phar文件
6.远程下载失败:可能是ssl证书问题,从新下载证书并上传替换即可
7.git地址读取失败:composer本地下需要添加git环境变量(path),如不行需要手动添加添加
;“C:\path\to\git\bin”;“C:\path\to\\ \\ git\cmd“
Drupal安装Accelerated Mobile Pages (AMP)必备条件以及完整安装步骤
1.确认服务器为php5.5+版本和composer、git组件安装完毕
3.模板html和css修改教程,请参照amp标准
amp主题的css样式是写在主题模板下的,所以要修改样式得在模板(twig文件)下面修改,修改完之后刷新模板缓存。
8.3测试版本会报错,需要手动修改模板依赖
快捷指令:
下载依赖库和模块:
composer require drupal/amp
下载主题:
composer require drupal/amptheme
···
On the command line, enter the following commands in your project root directory:
* Download the AMP module and its dependencies, including the AMP library, with `composer require drupal/amp`.
* Download the AMP theme with `composer require drupal/amptheme`.
To do a modified install:
If you want to modify some of the properties of the downloaded composer.json before composer install is executed, use the --no-install flag when running composer create-project. For example, it is possible that you want to rename the subdirectory 'web' to something else.
To do that:
Runcomposer create-project drupal-composer/drupal-project:8.x-dev my_site_name_dir --stability dev --no-interaction --no-install
Change directories to my_site_name_dir and edit the composer.json file to suit your needs
Run composer install to download Drupal 8 and all its dependencies.
Refer to the README for atdrupal-composer/drupal-projectto learn more about this option's features and usage. If you are used to building Drupal site via drush make, refer to theFAQs in Drupal's Composer template documentationto learn the difference between this option and drush make.