You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

重装电脑后WAMP访问项目出现ERR_NAME_NOT_RESOLVED问题求助

Hey there, let's work through this ERR_NAME_NOT_RESOLVED issue you're hitting with your WAMP 3.1.3 setup. Since localhost loads fine but your specific project isn't resolving, this is almost always tied to virtual host configuration or local DNS mapping. Let's go step by step to fix it:

1. Double-Check Your Virtual Host Configuration

WAMP relies on Apache's virtual hosts to link your project folder to a custom domain. Let's verify this first:

  • Open the WAMP manager, hover over Apache and select httpd-vhosts.conf to edit the file.
  • Make sure your project has a properly formatted virtual host entry. It should look something like this:
    <VirtualHost *:80>
        ServerName yourproject.local
        ServerAlias www.yourproject.local
        DocumentRoot "C:/wamp64/www/yourprojectfolder"
        <Directory "C:/wamp64/www/yourprojectfolder/">
            Options +Indexes +Includes +FollowSymLinks +MultiViews
            AllowOverride All
            Require local
        </Directory>
    </VirtualHost>
    
    • Swap out yourproject.local with the exact domain you're trying to access, and C:/wamp64/www/yourprojectfolder with the real path to your project files.
  • Also, head to Apache > httpd.conf and ensure the line Include conf/extra/httpd-vhosts.conf isn't commented out (remove the # at the start if it's there) — this enables Apache to use your virtual host settings.
2. Update Your Local Hosts File

Your computer's hosts file tells it to map custom domains to your local IP. Here's how to edit it:

  • Open Notepad as Administrator (right-click the Notepad icon and select "Run as administrator").
  • Navigate to and open the file at C:\Windows\System32\drivers\etc\hosts.
  • Add these lines at the bottom, replacing the domain with your project's:
    127.0.0.1   yourproject.local
    127.0.0.1   www.yourproject.local
    
  • Save the file (you may need to confirm admin permissions when saving).
3. Restart WAMP Services

Any changes to config files won't take effect until you restart Apache:

  • Left-click the WAMP icon in your system tray, go to Apache > Restart Service.
  • Wait a few seconds for the service to restart, then try accessing your project domain again.
4. Check for Port Conflicts (If Using Non-Standard Ports)

If you're using a port other than 80 (like 8080), you need to align it across your config and browser URL:

  • In httpd-vhosts.conf, change <VirtualHost *:80> to <VirtualHost *:yourportnumber> (e.g., <VirtualHost *:8080>).
  • Your hosts file still points to 127.0.0.1, but when accessing the project, use yourproject.local:yourportnumber in the browser.
  • You can check for port conflicts via WAMP's manager: go to Tools > Port Usage to see if another program (like IIS, Skype, or another web server) is using your target port.
5. Clear Cache and DNS Entries

Old cached data can sometimes block the domain resolution:

  • Clear your browser's cache and cookies (use Ctrl+Shift+Delete on most browsers to open the clearing menu).
  • Open Command Prompt as Administrator and run ipconfig /flushdns to clear your local DNS cache.

If none of these steps work, double-check that your project folder path in the virtual host config is 100% correct. If you stored your project outside the default www folder, you might need to change Require local to Require all granted in the <Directory> block to give Apache access to those files.

内容的提问来源于stack exchange,提问作者Syphex

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 03:26:34