2

Please help me.

It's displayed below error when I have cloned and installed Magento 2.

enter image description here

1
  • I'm shooting in the dark here, but you most probably have a theme declared that does not have a proper image set. You can try to disable all the non-core themes and try again. and try to install your theme after everything works. to disable the theme edit the file app/design/frontend/{theme-name}/registration.php. Rename it to something else. (if the theme is located in the app/design folder). If it was installed by composer, then remove it from composer.json.
    – Marius
    Apr 29, 2020 at 13:01

3 Answers 3

9

i was trying to install Magento 2.3.5-p1 on WINDOWS 7 (32 bit) (yes it's out of date) and i run into the same error.

as per this thread, the error seems to be related to Windows platforms and the workaround was to add !file_exists($filename) condition to the if statement.

  • 1 Open vendor\magento\framework\Image\Adapter\Gd2.php file
  • 2 Find validateURLScheme function at line 96
  • 3 Append !file_exists($filename) condition to if statement :

private function validateURLScheme(string $filename) : bool
  {
      $allowed_schemes = ['ftp', 'ftps', 'http', 'https'];
      $url = parse_url($filename);

      
      // Here !
      if ($url && 
          isset($url['scheme']) && 
          !in_array($url['scheme'], $allowed_schemes) && 
          !file_exists($filename)
      ) {

          return false;
      }

      return true;
  }

Anyway, this tweak worked for me till an official fix since the issue is still Open.

3
3

Just ran into this problem for my Magento 2.3.5-p2 in wamp server on Windows 10.

It looks like it is windows related problem only (I am yet to confirm that), I had to add strlen($url['scheme']) > 1 in the function of vendor\magento\framework\Image\Adapter\Gd2.php file:

So the final function looks like this:

/**
 * Checks for invalid URL schema if it exists
 *
 * @param string $filename
 * @return bool
 */
private function validateURLScheme(string $filename) : bool
{
    $allowed_schemes = ['ftp', 'ftps', 'http', 'https'];
    $url = parse_url($filename);
    if ($url && isset($url['scheme']) && strlen($url['scheme']) > 1 && !in_array($url['scheme'], $allowed_schemes)) {
        return false;
    }

    return true;
}

Hope this helps someone.

1
  • Thank you very much
    – Robinio
    Apr 8 at 8:50
2

I got the same error.

I changed vendor\magento\framework\Image\Adapter\Gd2.php file, Line 63 to:

if (!$filename || filesize($filename) === 0) {

After this I can install magento.

Or you can change url to 127.0.0.1, maybe it is ok.

Hope I can help you.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.