Ubuntu 20.04上安装Nginx,MySQL,PHP
sudo apt update
安装Nginx
sudo apt install nginx
安装PHP7.4
sudo apt install php7.4 php7.4-common php7.4-cli
sudo apt install php7.4-curl php7.4-json php7.4-gd php7.4-mbstring php7.4-intl php7.4-bcmath php7.4-bz2 php7.4-readline php7.4-zip php7.4-mysql php7.4-soap
安装mysql
sudo apt-get install mysql-server mysql-client
alter user 'root'@'localhost' identified with mysql_native_password by '123456';//mysql8 needs to run
安装Composer
wget https://github.com/composer/composer/releases/download/1.10.22/composer.phar
mv composer.phar composer
chmod +x composer
sudo mv composer /usr/local/bin
安装ES
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.0-linux-x86_64.tar.gz
下载Magento2.4.0
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.0 /var/www/html/magento
repo.magento.com
Username: 6c940aca0e37a167bcf58214728b61e1
Password: 41d4210e76bf721a45f8787ae5a790dd
安装Magento2.4.0
bin/magento setup:install --base-url=http://51tjc.net/ \
--db-host=localhost --db-name=magento2_4_0 --db-user=root --db-password=123456 \
--admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com \
--admin-user=admin --admin-password=admin123 --language=en_US \
--currency=USD --timezone=America/Chicago --use-rewrites=1 \
--search-engine=elasticsearch7 --elasticsearch-host=localhost \
--elasticsearch-port=9200
关闭2FA
bin/magento module:disable Magento_TwoFactorAuth
安装示例数据
bin/magento sampledata:deploy
bin/magento module:enable Magento_CustomerSampleData Magento_MsrpSampleData Magento_CatalogSampleData Magento_DownloadableSampleData Magento_OfflineShippingSampleData Magento_BundleSampleData Magento_ConfigurableSampleData Magento_ThemeSampleData Magento_ProductLinksSampleData Magento_ReviewSampleData Magento_CatalogRuleSampleData Magento_SwatchesSampleData Magento_GroupedProductSampleData Magento_TaxSampleData Magento_CmsSampleData Magento_SalesRuleSampleData Magento_SalesSampleData Magento_WidgetSampleData Magento_WishlistSampleData
rm -rf var/cache/* var/page_cache/* var/generation/*
bin/magento setup:upgrade
bin/magento setup:di:compile
本文档详细介绍了如何在Linux Ubuntu 20.04上安装Magento 2.4+所需的基础组件,包括Nginx,PHP 7.4,MySQL,Composer以及Elasticsearch,并提供了Magento 2.4.0的安装步骤,包括关闭2FA和安装示例数据。

1132

被折叠的 条评论
为什么被折叠?



