cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.4.1 does not work properly homepage and login page for admin panel at localhost

SOLVED

Magento 2.4.1 does not work properly homepage and login page for admin panel at localhost

I decided to try Magento 2 so I tried to download the open-source version. After a lot of effort, I made it and I install Magento 2 on my localhost. The problem is when I go to the homepage I see this(1) and when I try to login I see this(2). I tried some possible solutions from the Magento forum and I changed some lines in the di.xml file and Validator.php. The change in the Validator file works in some parts (appear the login form but there is another problem I can not log in with the username and password, which I am sure are correct). Does anyone else have the same problem?

 

My PHP version 7.4.11.

I use xampp for localhost.

 

(1)(1)(2)(2)

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2.4.1 does not work properly homepage and login page for admin panel at localhost

Hello @apostolis_dimit 

 

Please follow the method at https://meetanshi.com/blog/solved-magento-2-2-7-and-2-3-admin-page-blank-issue/ for admin blank page issue.

 

Run the below commands:

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush

I hope it helps.

 

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

View solution in original post

3 REPLIES 3

Re: Magento 2.4.1 does not work properly homepage and login page for admin panel at localhost

Hello @apostolis_dimit 

 

Please follow the method at https://meetanshi.com/blog/solved-magento-2-2-7-and-2-3-admin-page-blank-issue/ for admin blank page issue.

 

Run the below commands:

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush

I hope it helps.

 

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

Re: Magento 2.4.1 does not work properly homepage and login page for admin panel at localhost

Hi  @Sanjay Jethva

 

Thank you !!!!  

Re: Magento 2.4.1 does not work properly homepage and login page for admin panel at localhost

<< Snipped >>

 

You need to replace

$realPath = $this->fileDriver->getRealPath($path);
With 
$realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
 
In 

C:\xampp\htdocs\magento\lib\internal\Magento\Framework\View\Element\Template\File\Validator.php