0

i was intalling magento 2.3.5 which the lattest magento edition on my local system and encountered this strange error. when i dig a bit in to it, i found this solution which works well but i wana know why this happens. am sharing full lines code that has been changes in order to make it working as they have not explained it. enter image description here

vendor\magento\framework\Image\Adapter\Gd2.php file. at line 96

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;

}

Pramod
  • 1,464
  • 1
  • 11
  • 38

2 Answers2

1

To answer your question "why this happens".

As you can see that the code in validateURLScheme() checks if parsed scheme is one of above four $allowed_schemes. Since windows directory convention is different than linux, the function always returns false due to local windows files do not validates the condition.

To avoid this convention issue we add !file_exists($filename) condition. !file_exists() will satisfy if condition only when file is not found. Since file is found it will return true from validateURLScheme(). Which solves our problem.

As Kalvin mentioned in comment Magento v2.3 is not supported in Windows OS as per official doc. So we had to make such changes in core files.

Hope it answers your question. Thanks

Abdul Pathan
  • 2,802
  • 10
  • 22
0

You cannot install Magento2.3.5 on Windows. It must be installed on Linux environment only. If you want to run Magento on Windows, use VM tools e.g. Vagrant , Virtual box, Docker. Many Magento features are supported under Linux only e.g. symlink inside pub/static css/js file

leo
  • 1,236
  • 1
  • 12
  • 29
  • as am not familiar with linux do you have any best tutorials that will help me install magento 2 over linux system – Pramod Jul 06 '20 at 06:05