Magento 2.3在本地主机中无法正常工作

时间:2018-12-06 06:43:14

标签: magento magento-1.9 magento2 magento-1.8

我已经在本地主机中安装了 Magento 2.3 ,并且安装成功。但是,当我打开一个管理URL时,它带有空白URL。另外,我的主页没有Magento默认徽标。而且我在首页上遇到另一个问题,当我单击创建一个帐户时,它成功重定向,但页面空白。

enter image description here

请参阅附件中的图像以获得更好的主意。

enter image description here

3 个答案:

答案 0 :(得分:2)

我认为这个小技巧会对您有所帮助。我记得我前段时间也遇到过同样的问题,所以这可能会帮助您。您必须在Validator.php中更改一些代码。在Validator.php中,只有一种方法( isPathInDirectories ),因此您必须更改以下行

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

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

路径:...vendor\Magento\Framework\View\Element\Template\File\Validator.php

答案 1 :(得分:0)

@Dhruv使用命令indexing:reindex后,首页运行正常。

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Admin>cd..

C:\Users>cd..

C:\>cd xampp\php

C:\xampp\php>php C:\xampp\htdocs\Magento3\bin\magento indexer:reindex
Design Config Grid index has been rebuilt successfully in 00:00:06
Customer Grid index has been rebuilt successfully in 00:00:02
Category Products index has been rebuilt successfully in 00:00:03
Product Categories index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:09
Product EAV index has been rebuilt successfully in 00:00:03
Stock index has been rebuilt successfully in 00:00:01
Inventory index has been rebuilt successfully in 00:00:01
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:02
Catalog Search index has been rebuilt successfully in 00:00:05

C:\xampp\php>

答案 2 :(得分:0)

在我的本地主机-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 codeMake sure the code should come like this image

现在,转到管理面板并刷新页面。它成功运行,没有任何问题。所有图标都出现了,徽标也出现了。

Admin Panel Sucess image

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

一切正常。

我希望它将用于解决此问题。