【问题标题】:Magento 2.3.3 dashboard keeps loadingMagento 2.3.3 仪表板不断加载
【发布时间】:2020-04-24 21:42:15
【问题描述】:

我已经在我的本地主机中安装了最新版本的 magento。 登录到管理面板仪表板后继续加载。
这是图片-

请帮忙解决这个错误。

【问题讨论】:

    标签: admin magento2 loading dashboard


    【解决方案1】:

    首先进入magento根目录,然后:

    vendor/magento/framework/view/element/tempalate/file/validator.php(不要完全复制这个url,只要按照这个路径)

    使用任何编辑器打开此文件并更改此行

     $realPath = $this->fileDriver->getRealPath($path); //you can comment this out
        with this one
    
    $realPath = str_replace('\\','/',$this->fileDriver->getRealPath($path));
    then goto to
    

    app/etc/di.xml

    并搜索 view_preprocessed

    你会发现一整行是这样的:

    Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink 并用 Copy

    更改 Symlink

    【讨论】:

      【解决方案2】:

      Magento 2.3

      1. 转到 \lib\internal\Magento\Framework\View\Element\Template\File

      2. 转到函数 isPathInDirectories 并将该函数替换为以下函数

         protected function isPathInDirectories($path, $directories)
         {
             if (!is_array($directories)) {
                 $directories = (array)$directories;
             }
             //$realPath = $this->fileDriver->getRealPath($path);
             $realPath = str_replace('\\','/',$this->fileDriver->getRealPath($path));
             foreach ($directories as $directory) {
                 //$realDirectory = $this->fileDriver->getRealPath($directory);
                 $realDirectory = str_replace('\\','/',$this->fileDriver->getRealPath($directory));
                 if ($realDirectory && 0 === strpos($realPath, $realDirectory)) {
                    return true;
                 }
             }
             return false;
         }
        
      3. 转到 app/etc/di.xml 然后搜索 view_preprocessed

      你会发现一整行是这样的:

      Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink 并更改为 Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

      【讨论】:

        【解决方案3】:

        #1。转到供应商/magento/framework/View/Element/Template/File/Validator.php# #2。转到函数 isPathInDirectories 并将函数替换为以下内容:#

        protected function isPathInDirectories($path, $directories)
         {
             if (!is_array($directories)) {
                 $directories = (array)$directories;
             }
             //$realPath = $this->fileDriver->getRealPath($path);
             $realPath = str_replace('\\','/',$this->fileDriver->getRealPath($path));
             foreach ($directories as $directory) {
                 //$realDirectory = $this->fileDriver->getRealPath($directory);
                 $realDirectory = str_replace('\\','/',$this->fileDriver->getRealPath($directory));
                 if ($realDirectory && 0 === strpos($realPath, $realDirectory)) {
                    return true;
                 }
             }
             return false;
         }
        

        #3。转到 app/etc/di.xml 然后搜索 view_preprocessed

        你会发现一整行是这样的:

        Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink 并更改为 Magento\Framework\App\View\Asset\MaterializationStrategy\Copy #

        【讨论】:

          猜你喜欢
          • 2020-12-22
          • 2020-09-05
          • 2021-11-23
          • 2014-01-03
          • 1970-01-01
          • 1970-01-01
          • 2018-10-02
          • 2016-03-12
          • 1970-01-01
          相关资源
          最近更新 更多