Informática y Software Práctico

XAMPP Apache green but localhost blank: fix in 2026

Post actualizado el día octubre 26, 2026 by DeiviSanzPlay

You fire up XAMPP, Apache turns green, you type localhost in the browser, and… nothing. A blank page, a connection refused, or a spinning wheel that never ends. If that XAMPP localhost error has you pulling your hair out, breathe. I’ve been through it more times than I care to admit, and almost always the culprit is something dumb and fixable in under five minutes.

Let’s skip the fluff. Here’s what actually breaks when XAMPP won’t load in the browser and how you kill the problem for good.

Apache isn’t really running (even if it looks like it)

First thing: is Apache actually alive? Open the XAMPP Control Panel and look at the module next to Apache. Green means go. If it flashes green for a second then dies, that’s your answer — Apache is crashing on startup, and no amount of refreshing the browser will fix it.

The XAMPP error when opening localhost almost always starts here. Click Logs next to Apache and read the last lines. Common killers: a missing Visual C++ Redistributable, a broken httpd.conf line, or port 80 already taken. Don’t guess — the log tells you exactly what’s wrong.

On Windows 11 and Windows 10, Apache also needs the Microsoft Visual C++ Redistributable (both x86 and x64) installed. If you skipped that step during setup, Apache will refuse to start with an error like “VCRUNTIME140.dll is missing.” Install it and restart the panel.

Port 80 is hijacked by another program

This is the classic. Skype, IIS, VMware, Docker Desktop, or even the Windows “World Wide Web Publishing Service” grab port 80 before XAMPP can. When that happens, Apache silently fails or shows a scary message about being unable to bind to port 80 — and the XAMPP localhost error appears out of nowhere.

Fix it fast on Windows: open Command Prompt as admin and run:

netstat -ano | findstr :80

That gives you the PID hogging the port. Match it in Task Manager and kill it. If it’s the Windows service, disable it with services.msc → “World Wide Web Publishing Service” → Startup type: Disabled.

Another route: change Apache’s port from 80 to 8080 in httpd.conf (look for Listen 80 and ServerName localhost:80). Then you access your projects at http://localhost:8080. Slightly ugly, but it works every time.

Blank white page on localhost — the PHP side of the story

A XAMPP blank page localhost scenario is different from a “connection refused.” If the browser connects but shows nothing, Apache is fine — PHP is the problem. Nine times out of ten it’s a fatal PHP error with display_errors turned off.

Open php.ini (in xampp/php/) and set:

  • display_errors = On
  • error_reporting = E_ALL

Restart Apache and reload. Now the blank page turns into a real error message pointing at the offending line. That’s the whole point — a blank page is just a shy error.

Also check the xampp/apache/logs/error.log file. The XAMPP error log is where the truth lives. I’ve seen people waste hours reinstalling XAMPP when the log literally said “PHP Parse error on line 12.”

Firewall and antivirus blocking localhost

Some firewalls — especially third-party ones like Comodo, Avast, or Bitdefender — block Apache from listening on local ports. You’ll know because Apache starts, but the browser still throws a XAMPP localhost error like “ERR_CONNECTION_REFUSED.”

Go into your firewall settings and allow httpd.exe to communicate on private networks. Same with mysqld.exe if MySQL is also misbehaving. On Windows Defender Firewall, click “Allow an app through firewall” and add Apache manually if it’s not listed.

An antivirus real-time scanner can also lock files XAMPP needs. If you’ve tried everything, temporarily disable it and test. If it works, add the XAMPP folder as an exclusion.

The htdocs folder and wrong URL mistakes

Sounds dumb, but half the “XAMPP doesn’t open in browser” complaints come down to the user typing the wrong URL or putting files in the wrong folder. Your projects must live inside C:xampphtdocs. If you placed them on the Desktop or in Documents, localhost will never see them.

If your project is in htdocs/mysite/, the correct URL is http://localhost/mysite/ — not http://localhost/mysite without the trailing slash, and definitely not with “https” (XAMPP doesn’t ship with SSL configured by default).

Also verify there’s an index.php or index.html in that folder. Apache’s DirectoryIndex looks for those names. If your file is called home.php, you’ll get a directory listing or a 403 — not your site.

MySQL errors that look like browser errors

Sometimes the XAMPP localhost error isn’t about Apache at all — it’s your PHP script failing to connect to MySQL, and the failure is so ugly the page dies. Check that MySQL is green in the control panel, then confirm your credentials match XAMPP defaults:

  • Host: localhost
  • User: root
  • Password: (empty by default)
  • Port: 3306

If you set a MySQL root password at some point and forgot, update your PHP connection script. That mismatch is a silent killer.

When reinstalling is actually the answer

I hate the “just reinstall” advice because it’s lazy. But there are real cases where XAMPP’s install is corrupted — usually after a Windows major update or a forced shutdown while Apache was running. Symptoms: Apache won’t start no matter what, logs are empty, and even the control panel crashes.

Before nuking everything, back up your htdocs folder and any databases you care about. Then uninstall XAMPP, delete the leftover C:xampp folder manually, and install the latest version. In 2026, XAMPP 8.2.x with PHP 8.2 is the safe bet. Anything older will fight you on modern PHP code.

Quick checklist before you rage-quit

  1. Apache and MySQL green in the control panel.
  2. Port 80 free (or switched to 8080).
  3. Visual C++ Redistributable installed.
  4. Project files inside htdocs with a proper index file.
  5. display_errors On in php.ini.
  6. Firewall not blocking httpd.exe.
  7. Error log checked, not ignored.

Run through that list and the XAMPP localhost error almost always disappears. If it doesn’t, paste the exact error from your log into the Apache Friends forum — someone there has seen your exact problem, usually that same afternoon.

The bottom line: XAMPP is not broken. Your config, your port, or your folder structure is. Find which one, fix it, and move on with your project.