Hello Archers,
Did you tried to install Magento 2 on XAMPP or localhost and stuck at 51%? And wasted your lot of time while searching for a solution? Don’t worry, here, you will find your solution if you still not able to install Magento 2 on XAMPP or stuck at 51% of installation process. This guide also has a step by step video to help you better.
Installation stops at 51% while installing Magento 2 on XAMPP or Localhost
So, first of all why we are seeing this error?
Because the Image Adapter tries to open image files with function validateURLScheme
, which return false always because its checking ‘URL’ format but local files not valid for this format. So, to fix this problem you need to replace this function with the function mentioned below. The location for that function is \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;
}
Once you replace that function, retry installation. It will work.
Black screen while accessing Magento 2 Admin panel
Another big problem you could face while installing Magento 2 on XAMPP is the black screen while accessing Magento 2 Admin panel.
To resolve this, you need to reach this php file:
\vendor\magento\framework\View\Element\Template\File\Validator.php
And search for this line, which look like this:
if (0 === strpos($realPath, $directory)) {
return true;
}
And replace it with the below one:
$realDirectory = $this->fileDriver->getRealPath($directory);
if (0 === strpos($realPath, $realDirectory)) {
return true;
}
Once you are done with replacing try to refresh the Magento 2 admin login page.
If you are having any issue accessing your dashboard, then you need to clear the cache. To do so go to the c:\xampp\php using your terminal/command prompt and run the following command to clear the cache
>php C:\xampp\htdocs\Magento\bin\magento setup:static-content:deploy -f
>php C:\xampp\htdocs\Magento\bin\magento cache:clean
If you found this guide working, kindly subscribe to our channel:
Nadeem Qusroo says
Hello I tried this but still the installation fails at 51%.
any suggestions ?
Nitin Sharma says
please follow the video..it should resolve the issue. What is your console says by the way?
Nitin Sharma says
please follow the video..it should resolve the issue. What is your console says by the way?
shrikant ghogare says
I have done the all process whatever you mentioned in video as well as in this articles but still i see the loader spinner in my admin I am not able to access the admin panel details. can you please help me in that
see attachment https://uploads.disquscdn.com/images/0889667b4f567bb39326d9d6445d845b8d786da2899bb37473ed6c4e63d70629.png
Nitin Sharma says
Hi, go to your XAMPP->php folder and then type
php C:xampphtdocsyourMagentoFolderbinmagento setup:static-content:deploy -f
php C:xampphtdocsyourMagentoFolderbinmagento cache:clean