Apache won't start in xampp
If you use XAMPP to run a local web server, you might have come across the problem whereby Apache will not start. You click the Start button in the XAMPP control panel, the green 'Running' message appears for a second or two, then disappears again, and Apache fails to start. This can be a very frustrating problem, as you get absolutely no feedback about why it won't start. I found 2 possible causes for this...
The first, and by the looks of things on Google, most common cause, is that some other application is using port 80 on your PC. A likely culprit is Skype. If you open Skype, and go to Tools->Options... and click on 'Advanced' followed by 'Connection', check whether the 'Use port 80 and 443 as alternatives for incoming connections' option is checked. If so, uncheck it, and make sure the port number in the box at the top is not 80.
If Skype is not using port 80, you might be able to work out what is using that port by opening the Windows command console (in Windows XP, go to Start->Run, type 'cmd' [without quotes] and press enter), and typing:
netstat -a -no
...then press enter. Look for 127.0.0.1:80 or 192.168.1.100:80. If you can see one of those, it is likely that another process is using port 80. Make a note of the value in the PID column (Process ID). Then type the following into the command window:
...and press enter. You should then be able to match the PID with the executable file that is using that port. It might be obvious from the file name which application is causing it, or you might have to look it up on google. You could also try ending the task in the windows task manager (do so at your own risk!).
The second cause I found, was that if there is an invalid or conflicting value in your php.ini file, it can cause Apache to bomb out and fail to start. Try replacing your php.ini with the default copy that comes with XAMPP (you can find php.ini that is used by xampp at runtime in the /xampp/apache/bin/ folder. A separate copy of php.ini [as supplied] is available in the /xampp/php/ folder), or undo any changes you may have recently made to php.ini. In my case, I found that trying to load both Zend Optimizer and ionCube caused the problem, so I had to comment out one of them.
If neither of these are the cause of your problem, the first place to start looking would be the Windows Event Log. Then panic.
This is such an irritating problem!!!!!!!
So I'm punting and uninstalling XAMPP and reinstalling. The equivalent of turning it off and back on again. We'll see how that goes.
Tried using this workaround no avail.
Only way i solved it was to keep reinstalling the application. But when uninstalling ensure than Apache is turned OFF and to delete all remaining folders in the xampp directory.
Install again and presto... works fine.
This may help those who cant seem to solve the issue
p.s. if changing skype ports doesn't work, shut down skype and find any service related to skype and shut them off too...
Hope this helps :)
unlike other makshift solutions lying around the net./
the explanation was just absolutely on point.
God Bless You.
thanks a lot, i solved installing the visual C 2008 redistributable!!
close xampp and run as admin. started the service no problem. hope this helps someone out!
If you also add this:
(i.e. open command prompt (as administrator in Windows 7) in the xampp/apache/bin folder
run httpd.exe, observe response (I got the following: (OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : AH00072: make_sock: could not bind to address [::]:80)
Which tells me port 80 is not available.
Sitepoint Craig Buckler's advice to check for "Web Deployment Agent Service" was exactly the problem! (not in the way he describes it, but running, in my case as a result of installing Microsoft Webmatrix, which I thought could help me with debug of PHP! Stopping that service allowed Apache to start (but yellow not green in xampp control panel)
So I stopped it again, restart failed..
And - this was the final fix....
Open Task manager -> Sort by description, scroll down to Apache HTTP server, "End process", go back to xampp and restart Apache! YESSSSSSSS
#LoadModule ssl_module modules/mod_ssl.so
made apache start
My problem was being caused by Web Deployment Agent Service (MsDepSvc), part of WebMatrix. Disabled that through Services and I'm good to go.
After looking around I realized that when you make changes to the modules you use like for example i downgraded from postgre 9.1 to 8.4 and xampp did not update this automatically, it is useful sometimes to check httpd.conf for values or modules that are no longer accessible, if the path has changed you may want to include the full path. this is because if apache doesnt find any of the files files listed it throws an error.
so, do look for both port 80 and 443 while you check from the command prompt using netstat -a -no.
Then for those people, for whom VMWare is the culprit,
Go to Edit > Preferences.
Click the Shared VMs.
DISABLE SHARING and this would mean port 443 is closed for access by VMWare and your apache on Xampp will run fine!