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

Windows更新重启后XAMPP无法访问localhost及phpMyAdmin求助

Fixing "This site can’t be reached" After Windows Update with XAMPP

Hey there, let's work through this issue together—Windows updates have a knack for messing with local dev environments, right? Here are the most common fixes to get your XAMPP PHP project back up and running:

1. Verify XAMPP Services Are Running

First things first: fire up your XAMPP Control Panel and double-check that Apache (and MySQL if your project uses it) is showing as "Running". If Apache fails to start, the most likely culprit is a port conflict:

  • Click the "Config" button next to Apache, open httpd.conf, and search for Listen 80—change it to Listen 8080.
  • Then open httpd-ssl.conf (also in the Apache config menu) and change Listen 443 to Listen 4433.
  • Save both files, restart Apache, and try accessing your project at http://localhost:8080 instead.

2. Check Windows Firewall Rules

Windows updates often reset firewall permissions, blocking Apache from communicating. Here's how to fix it:

  • Open Windows Defender Firewall and click "Allow an app or feature through Windows Defender Firewall".
  • Click "Change settings" (you'll need admin rights), then look for entries like "Apache HTTP Server" or httpd.exe.
  • Make sure both "Private" and "Public" (at least Private) are checked. If you don't see Apache listed, click "Allow another app", browse to [your XAMPP folder]/apache/bin/httpd.exe, add it, and enable the permissions.

3. Resolve Port Conflicts

If Apache won't start even after changing ports, a system process might be hogging the default ports. Let's check:

  • Open Command Prompt as admin and run:
    netstat -ano | findstr ":80"
    
  • Look for the PID number in the last column. If the PID is 4, that's the built-in HTTP.sys service. Disable it with these commands:
    net stop http
    sc config http start= disabled
    
  • Restart your computer, then try starting Apache again. If it's another PID, use Task Manager to find and close the process (like Skype, Teams, or a random background app).

4. Reset Apache Configuration Files

Windows updates can sometimes corrupt XAMPP config files. Try restoring defaults:

  • Backup your current httpd.conf and httpd-vhosts.conf (found in XAMPP/apache/conf/ and XAMPP/apache/conf/extra/).
  • Copy the default versions from the XAMPP installation package (or re-extract them if you still have the installer) and replace your existing files.
  • Restart Apache and test your project.

5. Check the Hosts File

Occasionally, updates modify the hosts file, breaking the localhost mapping:

  • Open Notepad as admin, then open C:\Windows\System32\drivers\etc\hosts.
  • Make sure you have this line at the top:
    127.0.0.1       localhost
    
  • Save the file, then run ipconfig /flushdns in Command Prompt to refresh DNS settings.

Try these steps in order—most of the time, the issue is either a port conflict or a firewall rule reset from the Windows update. Let me know if you hit any snags!

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.21 03:42:28