540 字
3 分钟
Alibaba Cloud Linux安装Drupal10.0.7

想学下Drupal,按部署LAMP环境(Alibaba Cloud Linux 3)部署环境,但是PHP7.4没法安装Drupal10,所以修改了一下。其实还是挺折腾的,弄了一周多的样子,各种踩坑,装好以后也是各种报错。好在这次安装基本都做了笔记,稍微整理下,供参考。

Apache2.4#

Compiling and Installing - Apache HTTP Server Version 2.4

yum install httpd

Mysql8.0#

wget http://dev.mysql.com/get/mysql80-community-release-el7-7.noarch.rpm && yum -y install mysql80-community-release-el7-7.noarch.rpm && yum -y install mysql-community-server --nogpgcheck

PHP8.1.18#

修改了下部署LAMP环境(Alibaba Cloud Linux 3)里的安装PHP命令:

rpm -ivh --nodeps https://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf update -y dnf libdnf
sed -i 's/PLATFORM_ID="platform:al8"/PLATFORM_ID="platform:el8"/g' /etc/os-release 
yum -y module install php:remi-8.1 
sed -i 's/PLATFORM_ID="platform:el8"/PLATFORM_ID="platform:al8"/g' /etc/os-release

phpMyAdmin5.2.1#

mkdir -p /var/www/html/phpmyadmin
cd
wget --no-check-certificate https://files.phpmyadmin.net/phpMyAdmin/5.2.1/phpMyAdmin-5.2.1-all-languages.zip
unzip phpMyAdmin-5.2.1-all-languages.zip
mv phpMyAdmin-5.2.1-all-languages/*  /var/www/html/phpmyadmin

部署成功后,phpMyAdmin无法登录显示“缺少mysqli扩展”、修复后登录数据库,页面底部如果显示“配置文件现在需要一个短语密码”、“缺少mcrypt扩展”,解决方法如下:

缺少mysqli扩展:#

安装mysqli(参考linux下php-mysql拓展安装):

yum install php-mysql

缺少mcrypt扩展:#

安装mcrypt(参考phpMyAdmin“缺少 mcrypt 扩展。请检查 PHP 配置。”解决办法):

yum  install  php-mcrypt  libmcrypt  libmcrypt-devel

配置文件现在需要一个短语密码:#

按百度经验配置文件现在需要一个短语密码 修改。

Drupal10.0.7#

修改了手动搭建Drupal网站这篇帮助里的一些命令,换了版本号。

下载Drupal:

cd
wget https://ftp.drupal.org/files/projects/drupal-10.0.7.zip

解压Drupal:

yum install unzip -y
unzip drupal-10.0.7.zip

将安装文件移动到Apache的网站根目录:

mv drupal-10.0.7/* /var/www/html
mv drupal-10.0.7/.htaccess /var/www/html
mv drupal-10.0.7/.csslintrc drupal-10.0.7/.editorconfig drupal-10.0.7/.eslintignore drupal-10.0.7/.eslintrc.json drupal-10.0.7/.gitattributes /var/www/html

下载中文翻译包:

cd /var/www/html
wget -P sites/default/files/translations https://ftp.drupal.org/files/translations/all/drupal/drupal-10.0.7.zh-hans.po

后续步骤同手动搭建Drupal网站

安装过程中CleanURL未激活#

/etc/httpd/conf/httpd.conf,找到<Directory “/var/www/html”>,将其中的

AllowOverride None

修改为

AllowOverride All

php-gd库缺失:#

yum -y install php-gd

Critical security announcements that starts with “Failed to fetch security advisory data”#

参考Responding to critical security update advisories | Updating Drupal | Drupal Wiki guide on Drupal.orgPHP OpenSSL requirements | System requirements | Drupal Wiki guide on Drupal.org 修改了settings.php file:

$settings['update_fetch_with_http_fallback'] = TRUE;