0

I am new to Magento. I have read the requirements for Magento. I dont have a linux box and I have to make do with my Windows one.

I am trying to install Magento 2.3 with sample data on XAMPP 7.3 by following https://www.mageplaza.com/devdocs/how-install-magento-2-windows.html.

I completed the installation. However when i hit localhost/magento (i have named the dir as magento in htdocs), it doesnt load the static assets like iamges, js, fonts. So i get almost an empty page

When i inspected the page(in chrome browser) and i noticed that static assets were not going loaded as most of the fonts, js etc were not there in pub/static dir.

I tried running magento setup:static-content:deploy -f to deploy the static files.

However there is no improvement and the page is empty (http://localhost/magento).

I am grateful for any help in resolving this issue.

Thanks

Localhost Magento page

IT guy
  • 11
  • 2
  • Please check below url ==> https://magento.stackexchange.com/questions/279966/magento-2-installation-on-windows-10-problem – Ishvar Patel Jun 27 '20 at 12:19
  • Have you looked into running linux in windows using hyper v? Long term could be easier. Or maybe docker via wsl https://docs.docker.com/docker-for-windows/wsl/ plenty of magento 2 docker stacks available – Dominic Pixie Jun 27 '20 at 19:55

1 Answers1

0

This is Magento bug. Wrong paths to Windows are generated. The fixed fix is

Magento 2.3.0 - 2.3.3

#/vendor/magento/framework/View/Element/Template/File/Validator.php:140

the string

if (0 === strpos($realPath, $directory)) {
    return true;
}

to replace

$realDirectory = $this->fileDriver->getRealPath($directory);
if ($realDirectory && 0 === strpos($realPath, $realDirectory)) {
   return true;
}

If You can't find out the (/vendor/magento/framework/) folder in magento 2.2.7 - 2.3.3 . Then You can check it here:

#lib\internal\Magento\Framework\View\Element\Template\File\Validator.php

And your other magento version check this link :-

https://magento.stackexchange.com/a/252293/85907

After change your run command :-

php bin/magento c:c
php bin/magento c:f

Hope this help you

Thanks ...

Mohit Patel
  • 3,778
  • 4
  • 22
  • 52