ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
**Magento 2的系统要求** PHP- PHP 5.6以上 数据库-MySQL 5.6+ Web服务器-Apache 2.2x或Nginx 1.7x 操作系统-跨平台 浏览器-Google Chrome,Internet Explorer或Firefox等 安全套接字层(SSL)-HTTPS的有效安全证书 WNMP - PHP,MySQL,Nginx **第1步:开启以下PHP扩展并修改php.ini和mysql.ini的配置参数.** php.ini ext-bcmath ext-ctype ext-curl ext-dom ext-gd ext-hash ext-iconv ext-intl ext-mbstring ext-openssl ext-pdo\_mysql ext-simplexml ext-soap ext-xsl ext-zip memory\_limit = 1024M max\_execution\_time = 18000s mysql.ini max\_allowed\_packet = 512M innodb\_log\_file\_size = 256M wait\_timeout = 600s **第2步:从[https://magento.com/tech-resources/download](https://link.zhihu.com/?target=https%3A//magento.com/tech-resources/download)下载Magento2** **第3步: 修改vendor\\magento\\framework\\View\\Element\\Template\\File\\Validator.php文件解决windows下因为路径问题导致的页面加载不出样式.** 修改: $realPath = $this->fileDriver->getRealPath($path); 为: $realPath = str\_replace('\\\\', '/', $this->fileDriver->getRealPath($path)); **第4步: 修改vendor\magento\framework\Image\Adapter\Gd2.php** ``` private function validateURLScheme(string $filename) : bool { $allowed_schemes = ['ftp', 'ftps', 'http', 'https']; $url = parse_url($filename); if ($url && isset($url['scheme']) && !in_array($url['scheme'], $allowed_schemes) && !file_exists($filename)) { return false; } return true; } ``` **第5步: 修改vendor/magento/framework/Interception/PluginListGenerator.php** $cacheId = implode('-', $this->scopePriorityScheme) . "-" . $this->cacheId; **最后:在线向导安装(Magento2.4以后不支持),或者执行如下命令安装Magento** C:/phpstudy\_pro/Extensions/php/php7.2.9nts/php.exe -dmemory\_limit=4G bin/magento setup:install --admin-firstname=John --admin-lastname=Smith[\--admin-email=jsmith@mail.com](mailto:--admin-email=jsmith@mail.com)\--admin-user=admin --admin-password=admin123 --base-url=http://localhost/ --db-host=localhost --db-name=magento-ce-2-3-0 --db-user=root --db-password=123456 --currency=USD --timezone=America/Chicago --language=en\_US --use-rewrites=1