{"id":305,"date":"2019-02-01T12:07:29","date_gmt":"2019-02-01T12:07:29","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2019\/02\/01\/solved-magento-2-2-7-and-2-3-admin-page-blank-issue\/"},"modified":"2025-09-01T11:43:58","modified_gmt":"2025-09-01T06:13:58","slug":"solved-magento-2-2-7-and-2-3-admin-page-blank-issue","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/solved-magento-2-2-7-and-2-3-admin-page-blank-issue\/","title":{"rendered":"Solved: Magento 2.2.7 and 2.3 Admin Page Blank Issue"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Magento 2&nbsp;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&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/magento-2-3-release\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2.3<\/a>!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you have recently upgraded or installed the latest version and face the&nbsp;<em><strong>Magento 2.2.7 and 2.3 admin page blank issue<\/strong><\/em>&nbsp;as shown below, follow the solution given in the post.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2019\/01\/admin-page-blank-issue-1024x492.png\" alt=\"magento 2.3 and Magento 2.2.7 admin page blank issue\" class=\"wp-image-4164\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Solution to Magento 2.2.7 and 2.3 Admin Page Blank Issue:<br><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">How to solve the Magento 2.2.7 admin page blank issue:<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Navigate to:&nbsp;<strong>\/vendor\/magento\/framework\/View\/Element\/Template\/File\/Validator.php:113<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You\u2019ll find this code:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">protected function isPathInDirectories($path, $directories)\n{\n    if (!is_array($directories)) {\n        $directories = (array)$directories;\n    }\n    foreach ($directories as $directory) {\n        if (0 === strpos($this->fileDriver->getRealPath($path), $directory)) {\n            return true;\n        }\n    }\n    return false;\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">which is to be replaced with the following code:<br><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">protected function isPathInDirectories($path, $directories)\n{\n    $realPath = str_replace('\\\\', '\/', $this->fileDriver->getRealPath($path));\n    if (!is_array($directories)) {\n        $directories = (array)$directories;\n    }\n    foreach ($directories as $directory) {\n        if (0 === strpos($realPath, $directory)) {\n            return true;\n        }\n    }\n    return false;\n}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How to solve the Magento 2.3 admin page blank issue:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Navigate to #<strong>\/vendor\/magento\/framework\/View\/Element\/Template\/File\/Validator.php:114<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Find the below string:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$realPath = $this-&gt;fileDriver-&gt;getRealPath($path);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">and replace it with:<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$realPath = str_replace('\\', '\/', $this-&gt;fileDriver-&gt;getRealPath($path));<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Is\u2019nt the solution easy to implement? So now you can\u00a0<a href=\"https:\/\/meetanshi.com\/magento-upgrade-service\" target=\"_blank\" rel=\"noreferrer noopener\">upgrade to Magento <\/a><a href=\"https:\/\/meetanshi.com\/magento-upgrade-service.html\" target=\"_blank\" rel=\"noreferrer noopener\">2<\/a><a href=\"https:\/\/meetanshi.com\/magento-upgrade-service\" target=\"_blank\" rel=\"noreferrer noopener\"> latest version<\/a>\u00a0without any issues!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Happy Administrating!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento 2&nbsp;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&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-305","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/305","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=305"}],"version-history":[{"count":4,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/305\/revisions"}],"predecessor-version":[{"id":21399,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/305\/revisions\/21399"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}