【问题标题】:magento 2.3 After install blank screenmagento 2.3 安装后黑屏
【发布时间】:2019-05-07 18:45:09
【问题描述】:

.

安装没有错误后,管理空白屏幕,但它在浏览器的控制台上给出错误。

【问题讨论】:

标签: magento magento2 magento-2.3


【解决方案1】:

在 lib\internal\Magento\Framework\View\Element\Template\File\Validator.php 中

替换

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

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

然后在终端中运行:

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f

【讨论】:

    【解决方案2】:

    在我的 localhost - XAMPP Server 中安装 Magento 2.3.3 时,我也面临同样的问题。它已成功安装,但是当我打开管理面板时,它出现了如下图所示的空白屏幕。 Admin Panel

    解决办法是:

    之后,我更改了如下代码。

    转到这个路径:..\vendor\magento\framework\View\Element\Template\File 然后打开这个文件Validator.php

    然后搜索这一行$realPath = $this->fileDriver->getRealPath($path);

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

    Image for reference to change the Validator.php file

    现在管理面板将成功显示。


    出现了管理面板,但问题是登录屏幕上没有出现 Magento 徽标。登录管理员Admin Panel 后,图标不会出现在仪表板上,并且它会不断加载,如下图Icon Don't Appear

    解决办法是:

    转到这个路径:..\app\etc 然后打开这个文件di.xml

    然后搜索这一行Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink

    替换行 Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

    Check this image for replacing the code & Make sure the code should come like this image

    现在转到管理面板并刷新页面。它成功地工作没有问题。所有图标都出现了,Logo也出现了。

    Admin Panel Sucess image

    现在转到客户区,如果您更新示例内容,页面将类似于此图像Client Page with Sample Content。否则会显示为“CMS 主页内容在此处”。

    一切正常。

    我希望它能用来解决这个问题。

    【讨论】:

      【解决方案3】:

      请按照以下说明进行操作。我希望它能解决您的问题。

      只需转到vendor/magento/framework/View/Element/Template/File/Validator.php 并找到函数 function isPathInDirectories 第 138 行。

      替换:

      $realPath = $this->fileDriver->getRealPath($path);
              foreach ($directories as $directory) {
                  if (0 === strpos($realPath, $directory)) {
                      return true;
                  }
              }
      

      与:

      $realPath = $this->fileDriver->getRealPath($path);
              foreach ($directories as $directory) {
                  $directory = $this->fileDriver->getRealPath($path);  //Add this line.
                  if (0 === strpos($realPath, $directory)) {
                      return true;
                  }
              }
      

      【讨论】:

        猜你喜欢
        • 2014-01-20
        • 2013-12-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-08-03
        • 1970-01-01
        • 2019-05-03
        • 1970-01-01
        相关资源
        最近更新 更多