Magento 2 is managing our ecommerce business smoothly and it handles from Magento 2 admin panel. However, sometimes a client has been facing admin blank page issue after completing migration and upgrade Magento 2.3 version.
I have been facing the same issue in my local after installing Magento 2.2.7 and 2.3.3. I am very surprised and shocked to see this issue because I have done just installing Magento 2.3 and then shown me admin blank page problems.
I have checked and debugged this issue in my local and found one solution and decide to create posts on my blog for helping developers, store owners and for all Magento lovers.
If you have upgraded or installed any latest Magento version and you are facing the Magento 2 admin page blank issue as shown below, then please follow the solution given in the post.
Solution for Magento 2 Admin Blank Page issue
Steps for How to Solve Magento 2.3 Admin Blank Page issue.
Please follow below steps.
1. Please go to below magento path location.
/vendor/magento/framework/View/Element/Template/File/Validator.php
2. Find the below code string in Validator.php(above) file.
$realPath = $this->fileDriver->getRealPath($path);
3. Please replace it with below code.
$realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
4. That's done. Please check or reload your admin page. It's working.
Now, If you are facing admin blank page issue in Magento 2.2.7 version, then please follow the steps for solving this issue.
Steps for How to Solve Magento 2.2.7 Admin Blank Page issue.
Please follow below steps.
1. Please go to below magento path location.
/vendor/magento/framework/View/Element/Template/File/Validator.php
2. Find the below code string in Validator.php(above) file.
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;
}
3. Please replace it with 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;
}
4. That's done. Issue solved. Please reload your admin page. Happy Coding.