cancel
Showing results for 
Search instead for 
Did you mean: 

Blank page at Magento2 login admin

Blank page at Magento2 login admin

Hi, 
I have installed Magento 2.3 and xamp 7.2.14

After finish installing Magento, i open the admin page of magento i see Blank page and cannot see user name password for login. 

Please help with this solution.

8 REPLIES 8

Re: Blank page at Magento2 login admin

Hard to tell without checking web server logs but this is normally due to a PHP error.

Check your web server error logs for more information as to what is causing this. Could be as simple a thing as missing a PHP module.

--
Problem solved? Click Accept as Solution!

Re: Blank page at Magento2 login admin

You need to confirm your PHP version is PHP 7.2 or more version.
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: Blank page at Magento2 login admin

Google search this, I had the same on a fresh 2.3 install, and there is a line of code you have to add to one of the files. It fixed it for me

 

 

https://magento.stackexchange.com/questions/256337/magento-2-3-how-to-fix-blank-admin-page-not-rende...

 

 

 

2

It's the core issue of Magento 2.3.0. To fix this issue you have to change the code in the core file of Magento.

Go to path /vendor/magento/framework/View/Element/Template/File/Validator.php In this file find

$realPath = $this->fileDriver->getRealPath($path);

Replace with

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

Re: Blank page at Magento2 login admin

Hello @vineet_singh1 

 

Please follow the steps at Solved: Magento 2.2.7 and 2.3 Admin Page Blank Issue for the solution.

 

Hope it helps Smiley Happy

---
If you've found my answer useful, please give"Kudos" and "Accept as Solution"

Re: Blank page at Magento2 login admin

Actually it's $realPath = str_replace('\\', '/',$this->fileDriver->getRealPath($path));

Re: Blank page at Magento2 login admin

This worked for me. Thanks.

Re: Blank page at Magento2 login admin

This is a common problem with Magento, please follow the below steps to fix this:

Goto: xampp/htdocs/vendor/magento/framework/View/Element/Template/File/Validator.php

Old Code: 
public function isValid($filename) { $filename = str_replace('\\', '/', $filename); if (!isset($this->_templatesValidationResults[$filename])) { $this->_templatesValidationResults[$filename] = ($this->isPathInDirectories($filename, $this->_compiledDir) || $this->isPathInDirectories($filename, $this->moduleDirs) || $this->isPathInDirectories($filename, $this->_themesDir) || $this->_isAllowSymlinks) && $this->getRootDirectory()->isFile($this->getRootDirectory()->getRelativePath($filename)); } return $this->_templatesValidationResults[$filename]; }

Replace with New Code: 

public function isValid($filename)
{
return true;
}

I was facing the same issues and by following I fixed the issue, Hope it will work for you




Re: Blank page at Magento2 login admin

Hello vineet_singh1,

 

Magento 2 CMS is a suitable platform for running an E-commerce business and can be administered using an admin panel. The admin is liable for the functionalities of the store. However, many users are facing the issue of a blank page in the admin panel after the upgrade or installation of Magento.

 

If you have recently upgraded or installed the latest version and encountered the Magento admin page blank issue, you must follow the steps below to fix the issue,

 

  • Firstly, navigate to the following path:

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

  • Now, locate the below code,
protected function isPathInDirectories($path, $directories)
{
    if (!is_array($directories)) {
        $directories = (array)$directories;
    }
    foreach ($directories as $directory) {
        if (0 === strpos($this->fileDriver->getRealPath($path), $directory)) {
            return true;
        }
    }
    return false;
}
  • Then, replace it with the below code:
protected function isPathInDirectories($path, $directories)
{
    $realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
    if (!is_array($directories)) {
        $directories = (array)$directories;
    }
    foreach ($directories as $directory) {
        if (0 === strpos($realPath, $directory)) {
            return true;
        }
    }
    return false;
}

 

If the issue persists, you can follow the ways mentioned below,

  • Firstly, navigate to below file path,

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

  • Then, locate the below string:
$realPath = $this->fileDriver->getRealPath($path);
  • Next, replace it with the following code,
$realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
  • Lastly, save the file and refresh Magento 2 admin page.

 

PHP memory limit:

 

You will have to check the server settings and increase the memory limit in files php.ini.htaccess, or index.php

  • If you can edit server configurations, open the php.ini and set a memory limit of 756M with the following command:
ini_set('memory_limit', '756M');
  • Finally, flush the Magento cache using the below command to apply changes,
php bin/magento cache:flush

I hope the ways above help you to solve the Magento "Blank page at login admin" issue.

 

------------------------------
Regards,
Rex M

AccuWeb Hosting | Magento Hosting