在CentOS7里安装apache2.4 php7.2 mysql 5.6环境

  打算安装magento 2.3.1,需要先安装运行环境。步骤如下:

  如果还没有阿里云ECS实例,请点击查看优惠价格和购买。

  1.yum install epel-release # 安装epel源
2.rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm # 安装remi源
3.rpm -Uvh http://repo.mysql.com/mysql-community-release-el7-7.noarch.rpm # 安装mysql源
4.yum update # 更新

5.yum –enablerepo=remi-php72 install php php-pdo php-mysqlnd php-opcache php-xml php-pecl-mcrypt php-gd php-devel php-intl php-mbstring php-bcmath php-json php-iconv php-soap php-zip # 启用remi php7.2源,安装php7.2及扩展

6.yum install mysql-server # 安装mysql 5.6
7.vi /etc/php.ini # 编辑php配置文件,将 memory_limit 值调高,如更改到1280M

  8.vi /etc/httpd/conf/httpd.conf # 编辑apache配置文件,在适当位置添加 LoadModule rewrite_module modules/mod_rewrite.so , 启用rewrite模块;且将/var/www/html目录的配置内容 AllowOverride None 更改为 AllowOverride All,以让magento的配置文件.htaccess生效

  9.systemctl restart httpd # 重启apache
10.将magento2的安装文件放到/var/www/html里,从浏览器里访问,开始安装

  参考:

  • https://tecadmin.net/install-php-7-apache-2-4-mysql-on-centos-rhel/
  • https://devops.ionos.com/tutorials/how-to-install-and-configure-magento-2-on-centos-7/