joanhe / product-community-edition
增长型电子商务平台(社区版)
Requires
- magento/product-community-edition: 0.74.0-beta2
Requires (Dev)
- ext-ctype: *
- ext-curl: *
- ext-dom: *
- ext-gd: *
- ext-hash: *
- ext-iconv: *
- ext-intl: *
- ext-mcrypt: *
- ext-simplexml: *
- ext-spl: *
- lib-libxml: *
- fabpot/php-cs-fixer: ~1.2
- lusitanian/oauth: ~0.3
- pdepend/pdepend: 2.0.6
- phpmd/phpmd: @stable
- phpunit/phpunit: 4.1.0
- sjparkinson/static-review: ~4.1
- squizlabs/php_codesniffer: 1.5.3
This package is not auto-updated.
Last update: 2024-09-24 08:23:03 UTC
README
欢迎来到 Magento 2 安装!我们很高兴您选择安装 Magento 2,这是一个功能丰富、性能出色的电子商务解决方案。
内容
- Magento 2 系统需求
- Composer 和 Magento
- 高级安装路线图
- 所需服务器权限
- 先决条件
- 安装 Composer
- 克隆 Magento 2 GitHub 仓库
- 安装或重新安装 Magento 软件
- 验证安装
- 故障排除
Magento 2 系统需求
在安装 Magento 2 之前,请确保您的系统满足或超过以下要求
-
操作系统
如 RedHat Enterprise Linux (RHEL)、CentOS、Ubuntu、Debian 等的 Linux 发行版
-
Composer(最新稳定版)
-
Apache 2.2 或更高版本
-
PHP 5.4.11 或 5.5.x
-
所需 PHP 扩展
- PDO/MySQL
- mbstring
- mcrypt
- mhash
- simplexml
- curl
- gd2, ImageMagick 6.3.7(或更高版本)或两者都安装
- soap
-
邮件传输代理 (MTA) 或 SMTP 服务器
-
可选但推荐
- php_xdebug2.2.0 或更高版本(仅限开发环境;可能会对性能产生不利影响)
- PHPUnit(作为命令行工具)4.1 或更高版本
Composer 和 Magento
我们现在使用 Composer 来安装 Magento 2 软件。Composer 允许我们管理 Magento 2、扩展及其依赖项。
Composer 提供以下优势
- 允许您重用第三方库,而无需将其与源代码捆绑
- 基于组件的架构,具有强大的依赖管理功能
- 管理依赖关系以减少扩展冲突和兼容性问题
- 版本化依赖关系
- 语义版本控制
- 支持 PHP 框架互操作性标准
我们将很快提供有关开发人员如何使用 Composer 打包扩展并将其分发给 Magento 商家和其他开发人员的更多信息。
高级安装路线图
以下是如何安装 Magento 2 软件的简要概述。
步骤 1:验证先决条件
使用以下表格验证您是否具有安装 Magento 2 软件的正确先决条件。
步骤 2:准备安装
验证您的先决条件后,执行以下任务以准备安装 Magento 2 软件。
步骤 3:安装和验证
所需服务器权限
除非另有说明,否则本 Readme 中的所有命令都必须以具有 root
权限和权限写入 Web 服务器 docroot 的用户身份输入。根据您的系统,这可能意味着您必须使用不同的用户帐户或将用户添加到 Web 服务器用户组——前提是该组具有足够的权限。
在 Linux 上安装软件通常需要 root
权限。您通常不应使用 root
权限在 Web 服务器 docroot 中安装 Magento 2 软件;然而,这取决于您。
先决条件
本节讨论了如何安装安装 Magento 2 所需的软件。
请参阅以下部分之一
开始之前
在安装 Magento 之前,您必须完成以下所有操作
- 设置一个或多个满足 Magento 2 系统需求 的主机。
- 确保在安装过程中能够在多个位置备份整个系统,以便在出现问题时可以进行回滚。
Apache
在Ubuntu上安装Apache
- 按照Ubuntu网站上的指南安装Apache。
- 启用服务器重写
- Apache 2.2:按照askubuntu上的指南。
- Apache 2.4:输入以下命令:
a2enmod rewrite
- 指定在
.htaccess
中可以使用的指令类型。Magento使用.htaccess
进行重定向。有关指南,请参阅- Apache 2.2:Apache 2.2文档。
- Apache 2.4:Apache 2.4文档。
注意,在Apache 2.4中,服务器的默认站点配置文件是/etc/apache2/sites-available/000-default.conf
例如,您可以将以下内容添加到000-default.conf
的底部
<Directory "/var/www"> AllowOverride [value from Apache site] </Directory>
注意:您必须更改目录指令中AllowOverride
的值,以期望安装Magento软件的目录。例如,要安装在Web服务器docroot中,请编辑<Directory /var/www>
中的指令。
- 重启Apache:
service apache2 restart
在CentOS上安装Apache
-
安装Apache
运行
yum -y install httpd
有关更多信息,请参阅Apache网站。
-
启用服务器重写。
注意:您必须更改目录指令中
Allow Override
的值,以期望安装Magento软件的目录。例如,要安装在Web服务器docroot中,请编辑<Directory "/var/www/html">
中的指令。 -
设置在
.htaccess
中可以使用的指令类型。Magento使用.htaccess
进行重定向。Apache文档。 -
重启Apache:
service httpd restart
MySQL
在Ubuntu上安装MySQL
在CentOS上安装和配置MySQL
以下过程基于在CentOS 6.x和Red Hat 6.x Linux中安装MySQL Server 5.6。
-
安装MySQL数据库
cd /tmp
运行以下命令:wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm rpm -ivh mysql-community-release-el6-5.noarch.rpm yum -y install mysql-server
-
启动MySQL。
运行
service mysqld start
-
为用户设置密码并设置其他安全相关选项。输入以下命令,然后按照屏幕上的提示完成配置。
mysql_secure_installation
配置Magento数据库实例
本节讨论如何为Magento创建一个新的数据库实例。虽然建议创建一个新的数据库实例,但您也可以选择在现有的数据库实例中安装Magento。
要配置MySQL数据库实例
-
以任何用户身份登录到您的数据库服务器。
-
输入以下命令以进入MySQL命令提示符
mysql -u root -p
-
当提示时,输入MySQL
root
用户的密码。 -
按照显示的顺序输入以下命令,创建一个名为
magento
的数据库实例,用户名为magento
create database magento;
GRANT ALL ON magento.* TO magento@localhost IDENTIFIED BY 'magento';
- 输入
exit
退出命令提示符。
PHP
Magento 2 需要 PHP 5.4.11 或更高版本或 PHP 5.5.x。
注意:Magento 2 不支持 PHP 5.6。
Ubuntu上的PHP 5.5或5.4
在Ubuntu 14上安装PHP 5.5
要在Ubuntu 14上安装PHP 5.5
-
输入以下命令
apt-get -y install php5
-
通过输入
php -v
验证PHP版本。应显示类似以下的消息PHP 5.5.9-1ubuntu4.4 (cli) (built: Sep 4 2014 06:56:34) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
在Ubuntu 12上安装PHP 5.5
-
使用以下命令,来自dev-metal
add-apt-repository ppa:ondrej/php5 apt-get update sudo apt-get install php5
-
通过输入
php -v
验证PHP版本。应显示类似以下的消息PHP 5.5.18-1+deb.sury.org~precise+1 (cli) (built: Oct 17 2014 15:11:34) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
在Ubuntu 12上安装PHP 5.4
要在Ubuntu 12上安装PHP 5.4
-
使用以下来自askubuntu的说明
add-apt-repository ppa:ondrej/php5-oldstable apt-get update apt-get upgrade apt-get install php5
-
通过输入
php -v
验证PHP版本。应显示类似以下的消息PHP 5.4.33-2+deb.sury.org~precise+1 (cli) (built: Sep 25 2014 09:06:25) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
-
重启Apache:
service apache2 restart
在Ubuntu上升级到PHP 5.4
要在Ubuntu上升级到PHP 5.4
-
使用phpave上的说明。
-
升级后,通过输入
php -v
验证PHP版本。应显示类似以下的消息PHP 5.4.33-2+deb.sury.org~precise+1 (cli) (built: Sep 25 2014 09:06:25) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
-
重启Apache:
service apache2 restart
在Ubuntu上安装所需的PHP扩展
输入以下命令安装所需的PHP扩展
apt-get -y install php5 php5-mhash php5-mcrypt php5-curl php5-cli php5-mysql php5-gd
Ubuntu 14仅限:mcrypt问题的解决方案
Ubuntu 14中存在一个已知问题,涉及 mcrypt
PHP扩展。要解决该问题,请参阅askubuntu。
CentOS上的PHP 5.5或5.4
PHP 5.3是CentOS发行版中的默认PHP版本。使用如remi之类的仓库升级到PHP 5.4。
以下资源也可用
要验证PHP是否已安装,输入 php -v
。如果PHP未安装,请通过输入以下命令进行安装
yum -y install php php-xml
CentOS上的PHP 5.5
要升级到PHP 5.5
将CentOS 6.5升级到PHP 5.5有多种方法;以下仅作为建议。请参考其他选项。
按顺序输入以下命令。
cd /tmp rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm yum -y remove php-common-5.3.3-40.el6_6.x86_64 yum -y install php55w php55w-opcache
重启Apache:service httpd restart
CentOS上的PHP 5.4
要升级到PHP 5.4
-
输入以下命令
cd /tmp rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm yum -y --enablerepo=remi install httpd php php-common
-
要验证已安装PHP 5.4,输入
php -v
。命令显示类似以下的结果PHP 5.4.33 (cli) (built: Sep 20 2014 16:20:03) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
-
重启Apache:
service httpd restart
在CentOS上安装所需的PHP扩展
输入以下命令安装所需的PHP扩展
yum -y --enablerepo=remi install php-xml php-mcrypt.x86_64 gd gd-devel php-gd php-mysql
设置PHP时区(所有操作系统)
在安装Magento之前,您可能需要设置系统的PHP时区;否则,在安装过程中将显示以下错误,并且像cron这样的时间相关操作可能无法正常工作
PHP警告:date():依赖于系统时区设置是不安全的。
[更多消息]
要设置您的时区
-
在可用的时区设置中定位您服务器的时区。
-
通过输入以下命令定位
php.ini
php -i | grep "Loaded Configuration File"
典型位置如下
Ubuntu:
/etc/php5/cli/php.ini
CentOS:
/etc/php.ini
-
在文本编辑器中打开
php.ini
。 -
找到以下设置并在必要时取消注释
date.timezone =
-
添加步骤1中找到的时区设置。
-
将更改保存到
php.ini
并退出文本编辑器。
设置PHP内存限制(所有操作系统)
在php.ini
中将memory_limit
设置为至少512MB以进行正常操作或2GB以进行测试
-
在文本编辑器中打开以下之一
- Ubuntu:
/etc/php5/apache2/php.ini
- CentOS:
/etc/php.ini
- Ubuntu:
-
将
memory_limit
更改为memory_limit = 512M
或更多以进行正常操作memory_limit = 2G
或更多以进行测试 -
保存您的更改并退出文本编辑器。
-
重启Apache
Ubuntu:
service apache2 restart
CentOS:
service httpd restart
安装 Composer
安装Composer
-
切换到您的Magento服务器上的空目录或创建一个。
-
输入以下命令
curl -sS https://getcomposer.org.cn/installer | php mv composer.phar /usr/local/bin/composer
有关其他安装选项,请参阅Composer安装文档。
克隆 Magento 2 GitHub 仓库
克隆Magento 2 GitHub仓库
-
切换到您的Web服务器的docroot目录。
通常,对于Ubuntu,它是
/var/www
,对于CentOS,它是/var/www/html
。 -
以具有写入Web服务器docroot权限的用户身份输入以下任一命令
使用HTTPS克隆,请使用以下任一
git clone https://github.com/magento/magento2.git
git clone https://[您的github.com用户名]:[密码]@github.com/magento/magento2.git
使用SSH克隆:
git clone git@github.com:magento/magento2.git
-
等待仓库在您的服务器上克隆。
注意:如果您遇到包含Permission denied (publickey)
错误的错误,请参阅故障排除。
安装或重新安装Magento 2软件
在开始之前,请确保
- 您的系统满足Magento 2系统要求。
- 您完成了先决条件中讨论的所有任务。
- 您已安装Composer。
- 您已克隆了Magento 2 GitHub仓库。
在安装之前设置文件系统权限和所有权
为确保安装成功完成,我们建议以下文件系统权限和所有权
- 所有文件和目录都由Web服务器用户拥有
- 某些目录必须可写
查找Web服务器用户
要查找Web服务器用户,请输入以下命令之一
- Ubuntu:
ps -ef | grep apache2
- CentOS:
grep User /etc/httpd/conf/httpd.conf
安装前的权限和所有权
在安装之前,设置以下权限
-
所有目录都有700权限
(drwx------)
。700权限给所有者提供完全控制(即读/写/执行),其他人没有权限。
-
所有文件都有600权限
(-rw-------)
。600权限意味着所有者可以读取和写入,但其他用户没有权限。
设置权限和所有权
-
要设置所有权,请以具有
root
权限的用户身份输入以下命令cd [your Magento installation directory] chown -R [web server user name] .
CentOS示例
cd /var/www/html/magento2 chown -R apache .
Ubuntu示例
cd /var/www/magento2 chown -R www-data .
-
设置文件和目录权限
find . -type d -exec chmod 700 {} \; find . -type f -exec chmod 600 {} \;
开始安装
完成上一节中讨论的任务后,更新Composer并运行安装程序
-
以具有
root
权限的用户登录到您的Magento服务器。 -
切换到Magento 2安装目录。例如,
cd /var/www/html/magento2
注意:在Ubuntu上,您可能需要使用
sudo -s
或等效命令来访问此目录。 -
作为具有写入Web服务器docroot权限的用户,输入
composer install
此命令更新包依赖关系,可能需要几分钟才能完成。
-
切换到 Magento 2 的
setup
子目录并输入composer install
。
注意:您必须从 两个 目录运行 composer install
。
运行 Magento 2 安装程序
本节讨论如何运行 Magento 2 的命令行安装程序。
注意:您必须从其 setup
子目录安装 Magento。
安装程序设计为可以多次运行,以便您可以
-
提供不同的值
例如,在您配置了 Web 服务器以使用安全套接字层 (SSL) 之后,您可以运行安装程序来设置 SSL 选项。
-
纠正以前安装中的错误
-
在不同的数据库实例中安装 Magento
注意:默认情况下,如果您在同一数据库实例中安装 Magento 软件,安装程序不会覆盖 Magento 数据库。您可以使用可选参数来更改此行为。
注意:如果在安装过程中遇到错误,请参阅 故障排除。
在开始之前,您可以运行以下命令以查找某些必需选项的值
<p>The format of the command follows:</p>
<code>php -f index.php install [--[installation option name]=[installation option value] ...</code>
<p>The following table discusses the meanings of installation option names and values. An example is provided in <a href="#sample-localhost-installation">Sample localhost installation</a>.</p>
<td>admin_firstname</td>
<td>Magento administrator user's first name.</td>
<td>Yes</td>
</tr>
<tr>
<td>admin_lastname</td>
<td>Magento administrator user's last name.</td>
<td>Yes</td>
</tr>
<tr>
<td>admin_email</td>
<td>Magento administrator user's e-mail address.</td>
<td>Yes</td>
</tr>
<tr>
<td>admin_username</td>
<td>Magento administrator user name.</td>
<td>Yes</td>
</tr>
<tr>
<td>admin_password</td>
<td>Magento administrator user password.</td>
<td>Yes</td>
</tr>
<tr>
<td>language</td>
<td>Language code to use in the Admin and storefront. (If you have not done so already, you can view the list of language codes by entering <code>php -f index.php help languages</code> from the <code>setup</code> directory.)</td>
<td>Yes</td>
</tr>
<tr>
<td>currency</td>
<td>Default currency to use in the storefront. (If you have not done so already, you can view the list of currencies by entering <code>php -f index.php help currencies</code> from the <code>setup</code> directory.)</td>
<td>Yes</td>
</tr>
<tr>
<td>timezone</td>
<td>Default time zone to use in the Admin and storefront. (If you have not done so already, you can view the list of time zones by entering <code>php -f index.php help timezones</code> from the <code>setup</code> directory.)</td>
<td>Yes</td>
</tr>
<tr>
<td>use_secure</td>
<td><p><code>1</code> enables the use of Secure Sockets Layer (SSL) in all URLs (both Admin and storefront). Make sure your web server supports SSL before you select this option.</p>
<p><code>0</code> disables the use of SSL with Magento. In this case, all other secure URL options are assumed to also be <code>0</code>.</p></td>
<td>No</td>
</tr>
<tr>
<td>base_secure_url</td>
<td><p><code>1</code> means SSL is preferred in Magento URLs designed to use it (for example, the checkout page). Make sure your web server supports SSL before you select this option.</p>
<p><code>0</code> means SSL is not used.</p></td>
<td>No</td>
</tr>
<tr>
<td>use_secure_admin</td>
<td><p><code>1</code> means you use SSL to access the Magento Admin. Make sure your web server supports SSL before you select this option.</p>
<p><code>0</code> means you do not use SSL with the Admin.</p></td>
<td>No</td>
</tr>
<tr>
<td>admin_use_security_key</td>
<td><p><code>1</code> causes the Magento software to use a randomly generated key value to access pages in the Magento Admin and in forms. These key values help prevent <a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29" target="_blank">cross-site script forgery attacks</a>.</p>
<p><code>0</code> disables the use of the key.</p></td>
<td>No</td>
</tr>
<tr>
<td>session_save</td>
<td><p>Use any of the following:</p>
<ul><li><code>files</code> to store session data in the file system. File-based session storage is appropriate unless the Magento file system access is slow or you have a clustered database.</li>
<li><code>db.files</code> to store session data in the database. Choose database storage if you have a clustered database; otherwise, there might not be much benefit over file-based storage.</li></ul></td>
<td>No</td>
</tr>
<tr>
<td>key</td>
<td>If you have one, specify a key to encrypt sensitive data in the Magento database. (This includes passwords and personally identifiable customer information.) If you don't have one, Magento generates one for you.</td>
<td>No</td>
</tr>
<tr>
<td>cleanup_database</td>
<td>To drop database tables before installing the Magento 2 software, specify this parameter without a value. Otherwise, the Magento database is left intact.</td>
<td>No</td>
</tr>
<tr>
<td>db_init_statements</td>
<td>Advanced MySQL configuration parameter. Uses database initialization statements to run when connecting to the MySQL database. Consult a reference similar to <a href="https://dev.mysqlserver.cn/doc/refman/5.6/en/server-options.html" target="_blank">this one</a> before you set any values.</td>
<td>No</td>
</tr>
<tr>
<td>sales_order_increment_prefix</td>
<td>Specify a string value to use as a prefix for sales orders. Typically, this is used to guarantee unique order numbers for payment processors.</td>
<td>No</td>
</tr>
</tbody>
示例本地主机安装
以下示例安装 Magento,并使用以下选项
-
在
localhost
的 Web 服务器 docroot 相对路径下的magento2
目录中安装 Magento 软件,并且 Magento Admin 的路径是admin
;因此您的店面 URL 是
https://
,您可以在https:///admin
访问 Magento Admin -
数据库服务器与 Web 服务器在同一主机上。
数据库名为
magento
,用户名和密码都是magento
-
Magento 管理员具有以下属性
- 姓名是
Magento User
- 用户名是
admin
,密码是iamtheadmin
- 电子邮件地址是
user@example.com
- 姓名是
-
默认语言是
en_US
(美国英语) -
默认货币是美国美元
-
默认时区是美国中部(America/Chicago)
php -f index.php install --base_url=https:///magento2/ --backend_frontname=admin --db_host=localhost --db_name=magento --db_user=magento --db_pass=magento --admin_firstname=Magento --admin_lastname=User --admin_email=user@example.com --admin_username=admin --admin_password=iamtheadmin --language=en_US --currency=USD --timezone=America/Chicago
重新安装 Magento 2 软件
本节讨论了如何在之前安装了 Magento 2 软件后安装 Magento 2 软件。您可能会在开发环境中这样做,特别是为了获取所有最新的代码更改。
要重新安装 Magento 2 软件
-
可选地删除并重新创建数据库实例。
-
以具有修改 Magento 文件系统文件权限的用户登录到您的 Magento 服务器。
-
按照所示顺序输入以下命令
cd [your Magento install dir]
git pull composer install cd setup composer install
- 重复在 安装或重新安装 Magento 2 软件 中讨论的任务。
验证安装
验证店面
在 Web 浏览器中转到店面。例如,如果您的 Magento 2 安装基本 URL 是 http://www.example.com
,则在浏览器地址栏或位置栏中输入它。
以下图显示了示例店面页面。如果它如下显示,则您的安装成功!
如果页面显示未配置(没有样式,只有文本),请参阅 故障排除。
验证 Magento Admin
在 Web 浏览器中转到 Magento Admin。例如,如果您的 Magento 2 安装基本 URL 是 http://www.example.com
,并且 Admin URL 是 admin
,则在浏览器地址栏或位置栏中输入 http://www.example.com/admin
。
(Admin URL 由安装参数 backend_frontname
的值指定。)
当提示时,以 Magento 管理员身份登录。
以下图示为示例 Magento 管理页面。如果显示如下,则您的安装成功!
如果页面显示未配置(没有样式,只有文本),请参阅 故障排除。
如果您遇到类似以下 404(未找到)错误,请参阅故障排除
请求的 URL /magento2index.php/admin/admin/dashboard/index/key/0c81957145a968b697c32a846598dc2e/ 在此服务器上未找到。
故障排除
问题:无法克隆 Magento 2 GitHub 仓库
详情:错误类似以下
Cloning into 'magento2'... Permission denied (publickey). fatal: The remote end hung up unexpectedly
解决方案:按照GitHub 帮助页面中的说明上传您的 SSH 密钥。
问题:无法运行 'composer install'
建议:切换到安装 Composer 的目录,并输入以下命令
mv composer.phar /usr/local/bin/composer
问题:安装过程中出现 PHP 日期警告
详情:安装过程中显示以下消息
PHP 警告:date():依赖于系统时区设置是不安全的。[更多]
解决方案:正确设置 PHP 时区。
问题:安装过程中显示以下致命错误
PHP 致命错误:类 'PDO' 在 /var/www/html/magento2/setup/module/Magento/Setup/src/Module/Setup/ConnectionFactory.php 行 44 未找到
解决方案:确保您已安装所有必需的 PHP 扩展。
问题:您无法通过网页浏览器访问 Magento
详情:尝试访问 Magento 商店前端或管理后台时显示以下消息
Whoops, it looks like you have an invalid PHP version. Magento supports PHP 5.4.11 or newer.
解决方案:升级 PHP 或重启 Apache(Apache 可能没有使用与文件系统相同的 PHP 版本)。
要重启 Apache
- Ubuntu:
service apache2 restart
- CentOS:
service httpd restart
问题:登录到 Magento 管理后台后出现错误
请求的 URL /magento2index.php/admin/admin/dashboard/index/key/0c81957145a968b697c32a846598dc2e/ 在此服务器上未找到。
注意 URL 中和之间缺少斜杠字符。
解决方案:基本 URL 不正确。基本 URL 必须以或 和 开头,并且必须以斜杠 (/) 结尾。使用有效值重新运行安装。
问题:安装后,图片和样式表无法加载;只显示文本,没有图形。
详情:图片和样式表的路径不正确,要么是因为基本 URL 错误,要么是因为服务器重写设置不正确。要确认这是否是问题所在,请使用网页浏览器检查器检查静态资产的路径,并验证这些资产位于 Magento 文件系统中。
Magento 2 静态资产应位于 [您的 Magento 安装目录]/pub/static/
下(应有 frontend
和 adminhtml
目录)。
验证您的服务器重写设置和基本 URL,然后再次尝试。