WampServer主机文件未退出

时间:2018-12-03 04:25:02

标签: wampserver

我的wamp服务器安装后出现问题。但是,我的Wamp服务器仍然正常运行,但是我可以知道如何纠正此错误吗?

错误如下:

  

文件C:/ WINDOWS / system32 / drivers / etc / hosts不可写

     

文件C:/ WINDOWS / system32 / drivers / etc / hosts不存在

Screen Shot

我可以知道如何纠正它吗?

1 个答案:

答案 0 :(得分:0)

检查此C:/WINDOWS/system32/drivers/etc路径,可能是您的主机文件丢失。只需按照以下步骤解决问题即可。

  1. 在桌面上创建新的文本文件,并将其重命名为“主机”。不要添加扩展名。
  2. 使用任何文本编辑器打开它,粘贴以下代码并保存。

    # Copyright (c) 1993-2006 Microsoft Corp.
    #
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    #
    # This file contains the mappings of IP addresses to host names. Each
    # entry should be kept on an individual line. The IP address should
    # be placed in the first column followed by the corresponding host name.
    # The IP address and the host name should be separated by at least one
    # space.
    #
    # Additionally, comments (such as these) may be inserted on individual
    # lines or following the machine name denoted by a '#' symbol.
    #
    # For example:
    #
    #      102.54.94.97     rhino.acme.com          # source server
    #       38.25.63.10     x.acme.com              # x client host
    # localhost name resolution is handle within DNS itself.
    #       127.0.0.1       localhost
    #       ::1             localhost 

  1. 现在将文件移至C:/WINDOWS/system32/drivers/etc文件夹。
  2. 退出WAMP(如果正在运行),然后重新启动。该错误将消失。

有关更多详细信息,请在此处查看Microsoft支持文章:https://support.microsoft.com/en-us/help/972034/how-to-reset-the-hosts-file-back-to-the-default