Magento 2 - 添加示例数据后“未设置区号:”
2022-08-30 15:59:40
所以我已经让magento 2运行良好,我甚至开始了自己的主题,但我在安装magento后尝试安装示例数据。它在终端中返回了“未设置区号:”,以下是我的步骤。
bin/magento sampledata:deploy
composer update
这将返回:
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing magento/module-catalog-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-bundle-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-widget-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-customer-sample-data (100.0.3)
Downloading: 100%
- Installing magento/sample-data-media (100.0.3)
Downloading: 100%
- Installing magento/module-theme-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-cms-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-catalog-rule-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-sales-rule-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-review-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-tax-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-grouped-product-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-downloadable-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-msrp-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-sales-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-product-links-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-configurable-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-wishlist-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-swatches-sample-data (100.0.3)
Downloading: 100%
- Installing magento/module-offline-shipping-sample-data (100.0.3)
Downloading: 100%
Writing lock file
Generating autoload files
然后我运行:
bin/magento setup:upgrade
我在下面的屏幕截图中得到了以下错误,我似乎找不到其他人在网上有同样的错误。
[Magento\Framework\Exception\SessionException]
Area code not set: Area code must be set before starting a session.
[Magento\Framework\Exception\LocalizedException]
Area code is not set
现在我的法师安装不起作用 - 错误返回:
请升级您的数据库:从Magento根目录运行“bin/magento setup:upgrade”。
我不能这样做,因为它返回和错误,任何帮助都会很棒。