magento2 composer安装

  1. composer 下载magento
composer create-project --repository=https://repo.magento.com/ magento/project-community-edition 

指定版本:

composer create-project --repository=https://repo.magento.com/ magento/project-community-edition=2.1.2 
  1. 指定文件权限
cd /var/www/html/
find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
chown -R :www-data . // Ubuntu
chmod u+x bin/magento
  1. 命令行安装magento
php bin/magento setup:install \
--base-url=http://demo2..com \
--db-host=127.0.0.1 \
--db-name=urvapin6 \
--db-user=ave40 \
--db-password=1lovejhin440 \
--backend-frontname=admin \
--admin-firstname=admin \
--admin-lastname=admin \
[email protected] \
--admin-user=admin \
--admin-password=admin123 \
--language=en_US \
--currency=USD \
--timezone=America/Chicago \
--use-rewrites=1

4.修改服务器目录、配置域名

/etc/nginx/sites-available/
service nginx restart

5.php版本切换

update-alternatives --set php /usr/bin/php7.2
  1. php安装扩展
sudo apt-get install php7.0 php7.0-fpm php7.0-mysql php7.0-curl php7.0-gd php7.0-xsl php7.0-json php7.0-mbstring php-gettext php7.0-mcrypt php7.0-xmlrpc libapache2-mod-php7.0 php7.0-intl php7.0-zip php7.0-cli php7.0-soap php7.0-common php7.0-mcrypt -y

你可能感兴趣的:(Magento)