cancel
Showing results for 
Search instead for 
Did you mean: 

magento 2.x in windows via xampp problems

SOLVED

magento 2.x in windows via xampp problems

hello i'm trying to install magento on windows 10 via xampp the installation occurs normally, however when accessing the adm page and the store page I run into these problems attached

 

and I noticed that some .dlls are not in the xampp \ php \ ext folder like:

php_dom.dll

php_pcre.dll

php_simplexml.dll

php_libxml.dll

 

among others that I managed to find

 

I would like to know these two factors are linked

 

Capturar.PNGCapturar02.PNGCapturar3.PNGCapturar07.PNG

1 ACCEPTED SOLUTION

Accepted Solutions

Re: magento 2.x in windows via xampp problems


@MayurSisodia wrote:

Hello,

 

Please try this one. May be it will help you.

Open this file.

vendor\magento\framework\View\Element\Template\File\Validator.php

Find the function isPathInDirectories and replace it with this function.

 

protected function isPathInDirectories($path, $directories)
     {
         if (!is_array($directories)) {
             $directories = (array)$directories;
         }
         $realPath = $this->fileDriver->getRealPath($path);
         $realPath = str_replace('\\', '/', $realPath); // extra code added
         foreach ($directories as $directory) {
             if (0 === strpos($realPath, $directory)) {
                 return true;
             }
         }
         return false;
     }

If answer will helps you then please accept.


hello I did the installation of magento via ubuntu and it worked normally,

I researched and saw that it doesn't work on windows.

 

View solution in original post

3 REPLIES 3

Re: magento 2.x in windows via xampp problems

HI @artur01via91aa 

There might be some permission issue.
https://devdocs.magento.com/guides/v2.3/config-guide/prod/prod_file-sys-perms.html

Try the following command once:

find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento

You can use sudo as well.


If still face issue, then try following command s once to re generations.

 

chmod -R 0777 var/ pub/ generated/
rm -rf var/cache/* var/view_preprocessed/* generated/* pub/static/*
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush


To enable error reporting, edit app/bootstrap.php file.
and un-comment the below line from the file. 

ini_set('display_errors', 1);


I hope it will help you!

Re: magento 2.x in windows via xampp problems

Hello,

 

Please try this one. May be it will help you.

Open this file.

vendor\magento\framework\View\Element\Template\File\Validator.php

Find the function isPathInDirectories and replace it with this function.

 

protected function isPathInDirectories($path, $directories)
     {
         if (!is_array($directories)) {
             $directories = (array)$directories;
         }
         $realPath = $this->fileDriver->getRealPath($path);
         $realPath = str_replace('\\', '/', $realPath); // extra code added
         foreach ($directories as $directory) {
             if (0 === strpos($realPath, $directory)) {
                 return true;
             }
         }
         return false;
     }

If answer will helps you then please accept.



Problem solved? Click Accept as Solution!

Re: magento 2.x in windows via xampp problems


@MayurSisodia wrote:

Hello,

 

Please try this one. May be it will help you.

Open this file.

vendor\magento\framework\View\Element\Template\File\Validator.php

Find the function isPathInDirectories and replace it with this function.

 

protected function isPathInDirectories($path, $directories)
     {
         if (!is_array($directories)) {
             $directories = (array)$directories;
         }
         $realPath = $this->fileDriver->getRealPath($path);
         $realPath = str_replace('\\', '/', $realPath); // extra code added
         foreach ($directories as $directory) {
             if (0 === strpos($realPath, $directory)) {
                 return true;
             }
         }
         return false;
     }

If answer will helps you then please accept.


hello I did the installation of magento via ubuntu and it worked normally,

I researched and saw that it doesn't work on windows.