Thursday, April 2, 2015

Error: Apache shutdown unexpectedly [SOLVED]

Hello Guys,

So, I have been installing XAMPP on my office windows 8 machine and it didn't worked in first attempt. I knew it something is wrong with ports/config settings.
When I clicked on 'Start' button of XAMPP control panel, it showed me below error.

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

Problem detected!
Port 80 in use by "Unable to open process" with PID 4!
Apache WILL NOT start without the configured ports free!
You need to uninstall/disable/reconfigure the blocking application

or reconfigure Apache and the Control Panel to listen on a different port

Please follow the steps to solve this problem:

1) From XAMPP control panel click on Apache 'config' button. 

2) Now, httpd.conf file will be opened in text editor. 

3) Find (Control + F) Listen 80 replace it to Listen 8080

4) Again find ServerName localhost:80 replace it to ServerName localhost:8080

5) Now save the file and go to XAMPP control panel and click on 'Start' button. 

6) Now go to http://localhost:8080 you should see XAMPP index page. 
    Congratulations: You have successfully installed XAMPP on your system! :) 

So how did it worked ?

Your port 80 was busy and we are now using unique port i.e. 8080
So remember whenever you are going to access the localhost you will be using it like http://localhost:8080 same for phpmyadmin http://localhost:8080/phpmyadmin/

If you insist with default port 80 then you need to look in your computer and find which installed software is using port 80. 

e.g. skype uses default port 80. 
To clear that port, open skype then go to Tools > Options > Advanced > Connection > and in that uncheck 'Use port 80 and 443 for additional incoming connections' option. Then save it and restart the skype. Now your skype will use another unique port. 
Thats how you can clear port 80. 

Helpful ? comments please :)

No comments:

Post a Comment