Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache is not running from XAMPP Control Panel ( Error: Apache shutdown unexpectedly. This may be due to a blocked port)

I have installed XAMPP (xampp-win32-1.8.2-0-VC9-installer.exe) on Windows 7 successfully. But unfortunately, the following error was found during running Apache from XAMPP Control Panel:

5:38:38 PM  [Apache]    Error: Apache shutdown unexpectedly. 5:38:38 PM  [Apache]    This may be due to a blocked port, missing dependencies,  5:38:38 PM  [Apache]    improper privileges, a crash, or a shutdown by another method. 5:38:38 PM  [Apache]    Press the Logs button to view error logs and check 5:38:38 PM  [Apache]    the Windows Event Viewer for more clues 5:38:38 PM  [Apache]    If you need more help, copy and post this 5:38:38 PM  [Apache]    entire log window on the forums 

Error on running Apache at XAMPP Controm Panel

like image 258
Ripon Al Wasim Avatar asked Jul 30 '13 11:07

Ripon Al Wasim


People also ask

Why Apache is not running in XAMPP?

Resolve Apache Port Conflicts. If Apache cannot start, you won't be able to access your XAMPP dashboard or any sites you have installed on the platform. A port conflict may be the underlying problem. By default, Apache connects over port 80.

What to do if XAMPP is not working?

To make this change, open the XAMPP control panel but don't start MySQL or Apache. Instead, click on Configure in the Apache row and select the Apache (httpd. conf) option. Alternatively, you can navigate to C:\xampp\apache\conf\httpd.

How do I fix Apache port 80?

Another very easy option is to simply set Apache to listen on a different port. This can be done by clicking on the "Config" button on the same line as the "Apache" module, select the "httpd. conf" file in the dropdown, then change the "Listen 80" line to "Listen 8080". Save the file and close it.

Why is Apache not running from XAMPP control panel?

Apache is not running from XAMPP Control Panel ( Error: Apache shutdown unexpectedly. This may be due to a blocked port) Bookmark this question. Show activity on this post.

How to resolve the “XAMPP error Apache shutdown unexpectedly” message?

In this article, we covered three easy steps to resolve the “XAMPP error Apache shutdown unexpectedly” message: 1 Launch the Apache configuration settings from the XAMPP dashboard. 2 Open the httpd.conf file and change the default port from 80 to 8080. 3 Open the http-ssl.conf file and change the default port from 443 to 4433.

How to change Apache port in XAMPP?

So follow the below steps to change Apache port- Step1: Open XAMPP Control Panel click the Config button. Step2: Select the Apache (httpd.conf) option and Scroll down and find the line: Listen 80. Step3: Change the number 80 for another IP port number that isn’t in use.

How to fix Skype port is not used by XAMPP?

As the port is not used by Skype, but by some other internal applications, I followed the below steps to resolve the issue: Step 1 - From the XAMPP Control Panel, under Apache, click the Config button, and select the Apache (httpd.conf).


1 Answers

There are many possible answers for this problem. The most common and most likely is that you're running another program which is blocking port 80 or 443. If you've installed Skype, then you've found your problem! Change apache's port settings to 81 and apache will work. There's a good tutorial on that To check this you can open up your command line by clicking the start menu, and typing 'cmd', and enter the command

    netstat -nab 

this wil return a list of programs that will vaguely resemble this pattern

    [someprogram.exe]     UDP     [fe80::numbers:numbers:numbers:numbers%numbers]:portnumber 

You need to find a line (or lines) ending in :80 and terminate them in order to start apache. If there is no line ending in :80, there are more things you can do.

First, navigate to xampp's directory (default is c:\xampp) and double click apache_start.bat. This will open up a comand line and return more detailed errors about why apache can't run. Mostly, be looking for syntax errors that you could've created by editing your httpd.conf, or httpd-ssl.conf files. This is very easy to do if you've edited it and are a new user.

If still this fails, your last hope is to check the apache error log by clicking on the logs tab in apache's row in the xampp control panel and clicking error log.

If none of this works, don't give up! You got this!

Edit: If you change the port of apache, you will also have to go into httpd.conf (located in xampp/apache/conf) and near line 184, replace

ServerName localhost:80

with

ServerName localhost:81

It is also possible to specify port 81 in the url of your localhost, i.e.

localhost:81/my_project.php

like image 118
TheHiggsBroson Avatar answered Sep 23 '22 23:09

TheHiggsBroson