1. 安装Magento2
本地,Windows系统安装,环境为Xampp集成控制台 + PHP5以上,Composer本地调试时可装可不装,先下载XAMPP,安装是勾选Apache,Mysql即可,Filezilla 和 FileZilla server是用于远程文件上传和产品上线,本地测试不需要。界面如下,若下面有红色错误:
[Apache] Error: Apache shutdown unexpectedly.
[Apache] This may be due to a blocked port, missing dependencies,
[Apache] improper privileges, a crash, or a shutdown by another method.
[Apache] Press the Logs button to view error logs and check
[Apache] the Windows Event Viewer for more clues
[Apache] If you need more help, copy and post this
[Apache] entire log window on the forums
大概率是端口占用问题,在Apache/conf/httpd.conf文件中配置serverRoot,Servername和Listen即可,下载好magento2后将其解压在XAMPP的htdocs文件夹中,起名[Name],打开PHPAdmin新建一名称为[Name](与前同)的数据库。
打开链接localhost/[Name],进入安装界面,如果你下载的版本是带有Sample的,下载过程会超过20分钟,卡在66%,不要急,Just Wait。之后打开localhost/[Name]/admin(安装过程中你设置的管理员URL),打开,可能会出现页面一直转圈加载的问题,这时需要更高一些文件:
把magento\Framework\App\View\Asset\MaterializationStrategy\Symlink改为magento\Framework\App\View\Asset\MaterializationStrategy\Copy
然后改
保存,重启Apache,即可解决,有问题的评论区留下问题,我会看。YouTube教程:https://www.youtube.com/watch?v=pxJ-3sfxXTA