🔥 Just Launched! Werra Premium Template for HyväSee it in Action

Solved: Magento 2.2.7 and 2.3 Admin Page Blank Issue

By Sanjay JethvaUpdated on Jul 17, 2025 3 min read

Magento 2 CMS is a suitable platform to run E-commerce business and it can be administered via admin panel. Admin is responsible for the functionalities of the store and any error in the admin panel is not acceptable. However, the clients have been facing the issue of the blank page in the admin panel after upgrade or installation of Magento 2.2.7 and Magento 2.3!

Developers at Meetanshi have been solving this issue and decided to post it as a solution for all the store owners of Magento 2.2.7 and Magento 2.3.

If you have recently upgraded or installed the latest version and face the Magento 2.2.7 and 2.3 admin page blank issue as shown below, follow the solution given in the post.

magento 2.3 and Magento 2.2.7 admin page blank issue

Solution to Magento 2.2.7 and 2.3 Admin Page Blank Issue:

How to solve the Magento 2.2.7 admin page blank issue:

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

You’ll find this 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;
}

which is to be replaced with the following 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;
}

How to solve the Magento 2.3 admin page blank issue:

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

Find the below string:

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

and replace it with:

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

Is’nt the solution easy to implement? So now you can upgrade to Magento 2 latest version without any issues!

Happy Administrating!

Sanjay Jethva Full Image
Article bySanjay Jethva

Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe. His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.