magento2 安装

magento2 安装

magento2.4 安装

在根目录下执行下面代码

php bin/magento setup:install –base-url=http://miacka.sayii.com –db-host=localhost –db-name=miacka –db-user=root –db-password=root –admin-firstname=Admin –admin-lastname=Admin –admin-email=Admin@sayii.com –admin-user=admin –admin-password=admin123 –language=en_US –currency=USD –timezone=America/Chicago –use-rewrites=1 –search-engine=elasticsearch7 –elasticsearch-host=127.0.0.1 –elasticsearch-port=9200

安装时出现这种错误

In PatchApplier.php line 170:

  Unable to apply data patch Magento\Theme\Setup\Patch\Data\RegisterThemes for module Magento_Theme. Original exception message: Wrong file

In Gd2.php line 64:

  Wrong file

解决方法:

在根目录lib\internal\Magento\Framework\Image\Adapter\Gd2.php文件加下

[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)) {
return false;
}

return true;
}
[/php]

修改为

[php]
private function validateURLScheme(string $filename)
{
if(!file_exists($filename)) { // if file not exist
$allowed_schemes = [‘ftp’, ‘ftps’, ‘http’, ‘https’];
$url = parse_url($filename);
if ($url && isset($url[‘scheme’]) && !in_array($url[‘scheme’], $allowed_schemes)) {
return false;
}
}
return true;
}
[/php]

继续安装报 This is not implemented, as it is not possible to implement Argon2i with acceptable performance in pure-PHP错误时

确认extension=php_sodium.dll及 extension=php_soap.dll这两个扩展是否开启

发表评论

© 2022. powered by PHP 个人小站