当我试图在 Windows 中的 xampp 服务器上安装 magento 2.3.6 时,我在 Magento_Theme 的 magento 模块中遇到错误,错误是关于 Invalid Argument Exception 并在 /vendor/magento/framework/Image/Adapter/Gd2 中显示错误文件.php 与此 messafe 64 堆栈跟踪:0。
问问题
116 次
1 回答
0
我在谷歌搜索了这个答案,然后我得到了答案。
我在第 86 行替换了一个函数。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)) {
return false;
}
return true;
}
替换为以下功能
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;
}
}
于 2021-03-29T08:50:30.963 回答