Apache Won’t Start in XAMPP? Here’s a Simple Fix

Tech 930 views 158 likes 0 comments
Apache Shutdown Unexpectedly
Alex david du Selfie

By Alex David Du · Updated

Alex writes about gaming, tech, and simple online income ideas, and builds projects that bring ideas to life.

If you use XAMPP as often as I do for personal projects, client tests, or quick demos, you have probably seen this message, “Apache Shutdown Unexpectedly.” Apache starts, then stops. It feels random, but the usual causes are simple, like busy ports, missing files, or blocked permissions.

Fixing the “Apache Shutdown Unexpectedly” Error on Windows

If you’re on Windows and Apache won’t start, it’s often because something else is using port 80 or 443, or some needed files are missing. Sometimes, apps like Skype or other web servers take those ports without you realizing it. It can also be caused by missing system files or permission issues. Here’s how I fixed it step-by-step:

1. Change the Apache Ports

  • Open your XAMPP Control Panel.

  • Click “Config” next to Apache, then open httpd.conf.

  • Find all instances of port 80 and change them to 8080.

  • Also, update Listen 80 to Listen 8080 and ServerName localhost:80 to ServerName localhost:8080.

  • Save and close the file.

2. Update SSL Port

  • Back in the XAMPP Control Panel, open http-ssl.conf from Apache’s Config menu.

  • Change port 443 to 4433 in the same way.

  • Save and close.

3. Check Missing Dependencies

  • Look at the error logs for messages about missing DLLs like vcruntime140.dll.

  • If missing, download and install the latest Microsoft Visual C++ Redistributable for your system.

4. Run XAMPP as Administrator

  • Right-click your XAMPP Control Panel shortcut and choose “Run as administrator” to avoid permission issues.

5. Restart Apache

  • Stop and start Apache from the control panel.

That should get Apache back online on Windows.

Fixing the “Apache Shutdown Unexpectedly” Error on Mac

If you’re using a Mac, this error usually comes from the same stuff: port conflicts or config problems. Here’s what I did:

  1. Open the XAMPP Application Manager from your Applications folder.

  2. Go to the Manage Servers tab and select Apache Web Server.

  3. Click Configure, then open the httpd.conf file.

  4. Find where it says Listen 80 and change it to Listen 8080.

  5. Save the file and close it.

  6. Go back to the Manage Servers tab, stop Apache if it’s running, then start it again.

That usually does the trick on macOS.

Extra Tips and Troubleshooting

If you’re still stuck, here are a few more things to check:

  • Make sure only one XAMPP instance is running. Having multiple instances open can cause conflicts.

  • Check if other apps are using port 80 or 443. On Windows, run netstat -aon | findstr :80 in Command Prompt to see what’s using the port. On Mac, use lsof -i :80 in Terminal.

  • Kill any processes using those ports if needed. On Windows, use Task Manager or taskkill /PID [PID] /F. On Mac, use kill -9 [PID].

  • Verify XAMPP has admin rights to access necessary files and ports.

  • Look at Apache error logs for clues. They’re usually in xampp/apache/logs/error.log.

Try these steps, and you should get Apache back up.

What to remember

Apache shutting down unexpectedly in XAMPP can be a pain, but it’s usually fixable with a few tweaks. Changing ports, checking for missing files, and making sure you run XAMPP with admin rights usually does the trick.

If you keep running into issues, check the error logs. They’re your best friend for troubleshooting. And remember, this happens to almost everyone using XAMPP at some point, so you’re not alone.

Hopefully, this guide helped you get your local server back up and running fast.

Comments

No comments yet.

Please log in to leave a comment.