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

2
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 ...

3
  • Hello @IT guy check more link --- magento.stackexchange.com/a/269111/85907 Jun 27 '20 at 12:30
  • Thanks a lot. I will check
    – IT guy
    Jun 28 '20 at 16:51
  • I followed your suggestion to replace the code at /vendor/magento/framework/View/Element/Template/File/Validator.php:140. It worked !! Thanks. I have marked the response accordingly
    – IT guy
    Jun 28 '20 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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