Tuesday, October 04, 2011

XAMPP Apache Could Not Bind to Port 80

Recently, I had an issue starting up Apache. My Apache instance runs on a Windows 7 development box and also shares the box with IIS 7. Immediately I thought that it was IIS and of course that's a valid assumptions but binding IIS to port 81 did not solve the issue.

I received the following error while trying to start Apache:
D:\xampp>apache_start.bat
Diese Eingabeforderung nicht waehrend des Running beenden
Bitte erst bei einem gewollten Shutdown schliessen
Please close this command only for Shutdown
Apache 2 is starting ...
(OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions. : make_sock: could not bind to address [::]:80
(OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions. : make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

Apache konnte nicht gestartet werden
Apache could not be started
Press any key to continue . . .
D:\xampp>

Running a netstat I could see that something called SYSTEM was listening on port 80.
D:\canvas\xampp>netstat -aon | findstr :80
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4

It turns out that another service called SQL Server Reporting Services (SQLEXPRESS) was causing the conflict. Stopping the service through Component Services > Services allows you to start Apache on port 80.

*EDIT
On another machine at work a service called "Web Deployment Agent Service", part of Microsoft's WebMatrix, was also preventing Apache from binding to port 80.

4 comments:

Webmaster Juice said...

Thanks for your tip, it helped me solve this issue :)

Dub Worrier said...

Thanks,
this worked for me. SQL Server Reporting Services (SQLEXPRESS) was causing the conflict.

My w7 install did not have any obvious way of running component services as I dont have an Admin Tools to invoke it. So what I did was run comexp.msc from the Start / Run command which invokes component services gui and from there allowed me to stop the Reporting services service.

Jumbo said...

Argh, every time I return to using Xampp, I forget this. For me I always just stop World Wide Web Publishing Service via services.msc, which doesn't affect my web browsing AFAIK.

Unknown said...

Thanks for the info. Both SQL Server Reporting Services and Web Deployment Agent Service services were causing my issues. Once disabled, Apache runs like a champ.