magento2 composer安裝

  1. composer 下載magento
composer create-project --repository=https://repo.magento.com/ magento/project-community-edition <install-directory-name>

指定版本:

composer create-project --repository=https://repo.magento.com/ magento/project-community-edition=2.1.2 <install-directory-name>
  1. 指定文件權限
cd /var/www/html/<magento install directory>
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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章