Skip to content

Instantly share code, notes, and snippets.

@abdullahbutt
Last active July 29, 2019 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abdullahbutt/7db0df9179f9039ff3de8b0025d4579c to your computer and use it in GitHub Desktop.
Save abdullahbutt/7db0df9179f9039ff3de8b0025d4579c to your computer and use it in GitHub Desktop.
megento 2.3.x blank page issue solution
This is Magento bug. Wrong paths to Windows are generated. The fixed fix is:
Magento 2.3.0
#/vendor/magento/framework/View/Element/Template/File/Validator.php:138
the string
$realPath = $this->fileDriver->getRealPath($path);
to replace
$realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
Magento 2.2.7
/vendor/magento/framework/View/Element/Template/File/Validator.php:113
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;
}
to replace
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment