Magento 2.x Installation at 51% Error: (Wrong file in Gd2.php:64) Module ‘Magento_Theme’

While Installation Magento 2.3.x or Magento 2.4.x in Windows 10 Machine & getting below error.

Solution:: There are following below steps need to follow

[1] – Find validateURLScheme function in Path vendor\magento\framework\Image\Adapter\Gd2.php file. at line 96.

[2] – Replace function with this: !file_exists($filename)

private function validateURLScheme(string $filename) : bool
{
	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;
}

Leave a Reply

Your email address will not be published. Required fields are marked *