我已经在本地主机中安装了 Magento 2.3 ,并且安装成功。但是,当我打开一个管理URL时,它带有空白URL。另外,我的主页没有Magento默认徽标。而且我在首页上遇到另一个问题,当我单击创建一个帐户时,它成功重定向,但页面空白。
请参阅附件中的图像以获得更好的主意。
答案 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 code和Make sure the code should come like this image
现在,转到管理面板并刷新页面。它成功运行,没有任何问题。所有图标都出现了,徽标也出现了。
现在转到客户区,如果您更新示例内容,则页面看起来像此图像Client Page with Sample Content。否则,它将显示为“ CMS主页内容在此处”。
一切正常。
我希望它将用于解决此问题。