xampp magento blank page

Solutions on MaxInterview for xampp magento blank page by the best coders in the world

showing results for - "xampp magento blank page"
Agustín
12 Apr 2020
1This is Magento bug. Wrong paths to Windows are generated. The fixed fix is
2
3Magento 2.3.0 - 2.3.3
4
5#/vendor/magento/framework/View/Element/Template/File/Validator.php:140
6the string
7
8if (0 === strpos($realPath, $directory)) {
9    return true;
10}
11to replace
12
13$realDirectory = $this->fileDriver->getRealPath($directory);
14if ($realDirectory && 0 === strpos($realPath, $realDirectory)) {
15   return true;
16}
17Magento 2.2.7
18
19/vendor/magento/framework/View/Element/Template/File/Validator.php:113
20code
21
22protected function isPathInDirectories($path, $directories)
23{
24    if (!is_array($directories)) {
25        $directories = (array)$directories;
26    }
27    foreach ($directories as $directory) {
28        if (0 === strpos($this->fileDriver->getRealPath($path), $directory)) {
29            return true;
30        }
31    }
32    return false;
33}
34to replace
35
36protected function isPathInDirectories($path, $directories)
37    {
38        $realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
39        if (!is_array($directories)) {
40            $directories = (array)$directories;
41        }
42        foreach ($directories as $directory) {
43            if (0 === strpos($realPath, $directory)) {
44                return true;
45            }
46        }
47        return false;
48    }
49If You can't find out the (/vendor/magento/framework/) folder in magento 2.2.7 - 2.3.3 . Then You can check it here:
50
51#lib\internal\Magento\Framework\View\Element\Template\File\Validator.php