Magento2安装

运行环境及安装部署

  • 安装LNMP或LAMP环境
  • 修改PHP.ini
  • 安装Composer
  • 安装Magento2
  • 部署Magento2
    • 修改文件权限
    • 更新Magento2
    • 安装中文包

安装LNMP或LAMP环境

yum -y install wget screen
wget http://mirror.linuxeye.com/oneinstack-full.tar.gz
tar zxf oneinstack-full.tar.gz
cd oneinstack
screen -R oneinstack
./install.sh

修改PHP.ini

max_execution_time = 18000
memory_limit  = 1024 M

安装Composer

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

安装Magento2

# 开发版
composer create-project magento/community-edition {directory_name} -s dev --prefer-dist
# 稳定版
composer create-project magento/community-edition {directory_name} --prefer-dist
# 或指定下载地址,获取企业版
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition {directory_name};

创建MySQL数据库
开始网页安装,xxx.com/setup

部署Magento2

修改文件权限

cd magento2
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && find ./var -type d -exec chmod 777 {} \; && chmod 777 var/ -R && find ./pub/media -type d -exec chmod 777 {} \; && find ./pub/static -type d -exec chmod 777 {} \; && chmod 777 ./app/etc && chmod 644 ./app/etc/*.xml && chmod u+x bin/magento

更新Magento2

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy en_US -f
php bin/magento indexer:reindex
php bin/magento cache:clean && php bin/magento cache:flush

安装中文包

composer require mageplaza/magento-2-chinese-language-pack:dev-master
php bin/magento setup:static-content:deploy en_US zh_Hans_CN -f
php bin/magento cache:clean
php bin/magento cache:flush

你可能感兴趣的:(Magento2)