XAMPP,Apache - Error: Apache shutdown unexpectedly - apache

I got the same error of shutdown unexpectedly. I tried everything.
I uninstalled skype.
I tried changing the ports to 81,444 / 81,443 / 88/443 / 80,443(default).
I went to services and tried killing required one.
I went to windows firewall and created the new inbound rule too.
I uninstalled old apache and installed new one too. This worked for 1 day.
I checked whether the port 80 is busy or not but none of the services is using port
80,443. I used netstat -a command to check all the list of port for Win-8.
I tried stopping windows http services by "NET STOP HTTP".
I unchecked "Internet Information Services" from program and features.
I checked "Resource Monitor" for port usage. Port 80 is being used by HTTP server only
but not responding to xampp control panel.
In all of the above cases, I made the changes and restarted the laptop every time to take the effect. But nothing has worked. Each time i got the same error i.e "XAMPP, Apache - Error: Apache shutdown unexpectedly".
Please give me the solution for this error. I am very much frustrated now. Please help me. Any help would be appreciable. Thank you in advance.

It would be good if you enable Apache Logs in debug mode.
LogLevel debug
Also you can get easily notified for syntax issues with help of below command.
httpd -t

For your skype, go to Tools -> Options -> Advanced -> connection. Disable the "Use port 80 and 443 for alternatives for incoming connections"
Sign Out and Close all Skype windows. Try restart your Apache again.

Related

How do I free port 80? [duplicate]

I installed XAMPP 1.6.8 and for some reason it didn't work. Later realized port 80 is not free or not listening. How can I release it or make it free?
Thanks a lot!
I found out that what was taking over port 80 is http api service. I wrote in cmd:
net stop http
Asked me "The following services will be stopped, do you want to continue?" Pressed y
It stopped a number of services actually.
Then wrote localhost and wallah, Apache is up and running on port 80.
Important: Skype uses port 80 by default, you can change this in skype options > advanced > connection - and uncheck "use port 80"
netstat -ano
That will show you the PID of the process that is listening on port 80.
After that, open the Task Manager -> Processes tab. From the View -> Select Columns menu, enable the PID column, and you will see the name of the process listening on port 80.
I had this problem previously,
if you see the Task manager(after enabling the view for PID), you will find PID=4 is "port 80 in use by NT Kernel & System; "
Just go to
Control Panel
Programs
Turn Windows features on/off
check if the World wide web services under IIS is checked
If so, Uncheck and netstat(or TCPVIEW) again to see if 80 is free.
netstat -a -b
Should tell you what program is bound to port 80
use netstat -bano in an elevated command prompt to see what apps are listening on which ports.
But Usually following applications uses port 80 in windows.
IIS
World Wide Web Publishing service
IIS Admin Service
SQL Server Reporting services
Web Deployment Agent Service
Stop above applications if running and check!!!
Use TcpView to find the process that listens to the port and close the process.
Other option to try is to stop SQL Server Reporting Services.
You can use net stop http it will display which process is using. Moslty world wide web services are using
Try
netstat -anb -p tcp
that show ports and processes
I was trying to install nginx from here - http://nginx.org/en/docs/windows.html
Going to http://localhost/ will show something, at least a proper "not found" message
This is because 80 is the default port, and it was taken by other processes.
Now run below command:
net stop http
// Above command stopped below services
// - SSDP Discovery
// - Print Spooler
// - BranchCache
// - Function Discovery Resource Publication
// - Function Discovery Provider Host
Now, going to http://localhost/ will fail with a broken link page message.
Main process was BranchCache
This process, after stopped, will restart in a few seconds.
So we need to run other commands we need soon, an example below:
// this will stop
net stop http
// immeidately run other command you want to
start nginx
Now, going to http://localhost/ gave me:
Welcome to nginx!
Hope that helps.
Type in "netstat -ano" into your command line. I saw that it was showing something for Local Address port 0.0.0.0:80.
My issue was because I had SQL Server Reporting Services on Port 80. So I followed these instructions and changed the port # from 80 to 81:
http://seankilleen.com/2012/11/how-to-stop-sql-server-reporting-services-from-using-port-80-on-your-server-field-notes/
Here is a picture of my command line AFTER I changed the port number for SQL Server Reporting Services:
If you are still having the same issue, read this forum:
http://forum.wampserver.com/read.php?2,66196,66233#REPLY
This is just a guess, but since port 80 is the conventional port for HTTP, you may have a webserver running on your system. Is IIS active?
If you are running IIS you may have the web farm service running. That was what was killing my xampp.
Skype likes to use port 80 and blocks IIS. That was my prob.
I also had the same problem. net stop http didn't help and World wide web services option under IIS in Windows Control Panel was unchecked. So in XAMPP control panel I just checked the Svc checkbox near Apache start button (Install Apache as service) and rebooted Windows. And now each time Windows starts Apache is started automatically and occupies port 80 before any other service does. Worked for me!
Known Windows Services That Listen on Port 80
From Services Manager (run: services.msc), stop and disable these Windows Services which are known to bind to port 80.
Double click Service, and change ‘Startup Type’ to ‘Disabled’…
SQL Server Reporting Services (ReportServer)
Web Deployment Agent Service (MsDepSvc)
BranchCache (PeerDistSvc)
Sync Share Service (SyncShareSvc)
World Wide Web Publishing Service (W3SVC)
Internet Information Server (WAS, IISADMIN)
skype also using port 80 as default setting and you can uncheck it.
You might, or might not, have some of these Services installed and running.
In my case "SQL Server Reporting Services" was opening port 80.
Identify the real process programmatically
(when the process ID is shown as 4)
The answers here, as usual, expect a level of interactivity.
The problem is when something is listening through HTTP.sys; then, the PID is always 4 and, as most people find, you need some tool to find the real owner.
Here's how to identify the offending process programmatically. No TcpView, etc (as good as those tools are). Does rely on netsh; but then, the problem is usually related to HTTP.sys.
$Uri = "http://127.0.0.1:8989" # for example
# Shows processes that have registered URLs with HTTP.sys
$QueueText = netsh http show servicestate view=requestq verbose=yes | Out-String
# Break into text chunks; discard the header
$Queues = $QueueText -split '(?<=\n)(?=Request queue name)' | Select-Object -Skip 1
# Find the chunk for the request queue listening on your URI
$Queue = #($Queues) -match [regex]::Escape($Uri -replace '/$')
if ($Queue.Count -eq 1)
{
# Will be null if could not pick out exactly one PID
$ProcessId = [string]$Queue -replace '(?s).*Process IDs:\s+' -replace '(?s)\s.*' -as [int]
if ($ProcessId)
{
Write-Verbose "Identified process $ProcessId as the HTTP listener. Killing..."
Stop-Process -Id $ProcessId -Confirm
}
}
Originally posted here: https://stackoverflow.com/a/65852847/6274530
I faced the same issue and fixed it by making a small change in the httpd.conf file which can be obtained by clicking the config button along with the Apache option.
The change I made was to replace listen 80 with listen 8080.
For me, this problem began when I hosted a VPN-connection on my Windows 8 computer.
Simply deleting the connection from "Control Panel\Network and Internet\Network Connections" solved the problem.

Port 443 in use by "Unable to open process" with PID 4

I have a very strange problem with my Apache 2.4 working with Xampp 1.8.2 on Windows Server 2008 R2.
When I tried to start Apache server in XAMPP, an error message is shown:
[Apache] Problem detected!
[Apache] Port 443 in use by "Unable to open process" with PID 4!
[Apache] Apache WILL NOT start without the configured ports free!
[Apache] You need to uninstall/disable/reconfigure the blocking application
[Apache] or reconfigure Apache and the Control Panel to listen on a different port
However, the process with PID 4 is system! I've tried to restart my computer and it doesn't work.
I have installed Apache 2.4 via a tar.gz file sereral days ago, and uninstalled it. So, I don't think this behavior will cause the problem.
And here's the result using commond netstat -a -n -o | findstr 443
C:\Users\Administrator>netstat -a -n -o | findstr 443
TCP 0.0.0.0:443 0.0.0.0:0 LISTENING 4
TCP [::]:443 [::]:0 LISTENING 4
Can you tell me what to do?
Just change the sll port in httpd-ssl.conf file. It would be under C:\xampp\apache\conf\extra.
Find "443" and replace it with other values(e.g 8181), then start your apache again
I had the same problem: port-443-in-use-by-unable-to-open-process-with-pid-4
First I disabled the weather tile in Win* that apparently phones home to Redmond for updates after this showed on netstat list.
This didn't solve the problem. I looked at the post already here which mentioned VPNs, so
I went to Control Panel\Network and Internet\Network and Sharing Center and clicked on Change adapter settings
I clicked on Incoming Connections and right clicked on properties
The VPN click box at the bottom of the General tab was on, so I unchecked it
Under Users, I also unchecked a previous user I had allowed to copy some data weeks before
Then I clicked okay
Closed the control panel and restarted the XAMPP control panel
It fired right up without a problem.
Similarly, I experienced this:
Port 443 in use by "Unable to open process" with PID 6012!
When starting XAMPP Control Panel v3.2.1 for the first time.
In Task Manager I found that PID 6012 was Apache web server.
A copy of it was running in the background without the GUI,
and when I invoked the GUI it was trying to start another copy.
Killed the phantom copy and then XAMPP started up fine.
I didn't have to change any port settings.
Modify this
LocalDisk **>>** xampp **>>** apache **>>** conf **>>** httpd.conf
Line 58: Listen **80**
for this
Line 58: Listen **8080**
Modify this:
Line 220: ServerName localhost: **80**
for this
Line 220: ServerName localhost: **8080**
Modify this:
LocalDisk **>>** xampp **>>** apache **>>** conf >> extra **>>** httpd-ssl.conf
Line 36: Listen **443**
for this
Line 36: Listen **444**
Modify this:
Line 121: <VirtualHost _default_:**443**>
Line 125: ServerName www.example.com:**443**
For this
Line 121: <VirtualHost _default_:**444**>
Line 125: ServerName www.example.com:**444**
Simply run as Administrtor "xampp-control.exe"
I had the same problem. Another way to solve this problem when running XAMPP on Windows:
Open a CMD prompt and type in command:
net stop was /y
Run Dialog Box (press keys Win+R)
.. then type: services.msc
I then scrolled down to:
World Wide Web Publishing Service
Double clicked on it and clicked STOP (if this service status is Started)
3.Start Apache again with XAMPP :)
Link Ref: http://www.sitepoint.com/unblock-port-80-on-windows-run-apache/
Some process is using this port, so you can change the port that is used by xampp, to be able to use it.
For this job you have to do this:
1- Open httpd-ssl.conf in xampp\apache\conf\extra
2- Look for the line containing Listen 443
3- Change port number to anything you want. I use 4430. ex. Listen 4430.
4- Replace every 443 strings in that file with 4430.
5- Save the file.
Probably some process is using that port, i would guess you have another webserver running with ssl/tls already. You must trac down what process is using the port and shut it down. The fact that it does not help to restart your computer makes me think that you may find what you are looking for in msconfig. Try to have a look there, open prompt and write msconfig
post 443 is normaly used by secure http, => https
I have never used windows server but there could be some built in webserver that autostarts, have you ever installed another webserver?
Try use the command Netstat -a -n -o to see what process that is blocking. you can the process pid from the output.
The
Routing and RAS - service is your problem i guess look at this post
it does this, thats why its blocking:
SSTP tunneling protocol
Secure Socket Tunneling Protocol (SSTP) is a new form of virtual private networking (VPN) tunnel with features that allow traffic to pass through firewalls that block PPTP and L2TP/IPsec traffic. SSTP provides a mechanism to encapsulate PPP traffic over the SSL channel of the HTTPS protocol. The use of PPP allows support for strong authentication methods, such as EAP-TLS. The use of HTTPS means traffic will flow through TCP port 443, a port commonly used for Web access. Secure Sockets Layer (SSL) provides transport-level security with enhanced key negotiation, encryption, and integrity checking.
from tecsupport.ms
Below steps by sztupy worked for me
I went to Control Panel\Network and Internet\Network and Sharing Center and clicked on Change adapter settings
I clicked on Incoming Connections and right clicked on properties
The VPN click box at the bottom of the General tab was on, so I unchecked it
Under Users, I also unchecked a previous user I had allowed to copy some data weeks before
Then I clicked okay
Closed the control panel and restarted the XAMPP control panel
I simply went to the XAMMP config button in the XAMPP control panel GUI and clicked on Server and Port settings and I changed the SSL port value.
I had the same problem when I installed xampp on Windows 7. I installed Windows server and Web Deployment Agent Service (MsDepSvc.exe) which uses port 80. So I had an error PID 4 listening to port 80 when I ran apache.
Solution
Open task manager: (Ctrl+Shift+Esc) then find "MsDepSvc.exe" and disable it. Finally restart xampp
ref: http://www.honk.com.au/index.php/2010/10/20/windows-7-pid-4-listening-port-80-apache-cannot-star/
Here it was the "Work Folders" feature having been added on a Server 2012 R2. By default it is listening for HTTPS client requests on port 443 via the "System" process.
There is a Technet blog post explaining how to change that port number. Don't forget to add a corresponding firewall rule for your custom port and disable the existing one for port 443 though.
I got this same error and managed to fix it by closing Skype and running XAMP as Administrator, works perfectly now. So right click THE XAMP icon and click run as admin.
The port is being used by another process,
PID 4 means it is Windows System, you can open a cmd window with "super user/administrator" priviledges and write "net stop http", it will stop all the web services. Then check if it freed the port.
I had the same problem and it happened to be the "Routing and Remote Access Service". You open Services in the windows search, and then look for the specific service name. Change the startup of it to manual or automatic (whatever you decide).
Use some app like TCPView to help what port each App PID is using.
The origin of the problem seems to be Microsoft not knowing what the word disable Microsoft VPN means...
I ran task manager and looked for httpd.exe in process. Their were two of them running. I stopped one of them gone back to xampp control pannel and started apache. It worked.
I had the same problem and solved by doing following.
Go to Task Manager, click on services tab, order by pid's than if you find the related process, kill it otherwise, right click and click on show details, the process should be shown now. order by pid's than kill the related process.
I had this same problem with port 443, process id 4 and everything. For me it was not the VPN using the port, it was IIS. To fix this I opened up IIS and right clicked on my instance and stopped it. Then IIS Express(Or apache if you're using that) was able to use port 443. Hope this helps someone else.
I had a similar issue where port 443 was blocked by PID 4. After breaking my head for several hours I found the command netsh show urlacl which gave me an idea of the system process blocking the port.
To run command run cmd or windows shell in administrator mode.
netsh
http
show urlacl
I got response a which showed 443 was blocked by NT Service SSTPSvc Reserved URL
Response
https://+:443/sra_{BA195980-CD49-458b-9E23-C84EE0ADCD75}/
User: NT SERVICE\SstpSvc
Listen: Yes
Delegate: Yes
User: BUILTIN\Administrators
Listen: No
Delegate: No
User: NT AUTHORITY\SYSTEM
Listen: Yes
Delegate: Yes
With this information I followed the microsoft link to change the listening port for SSTP based vpn. https://support.microsoft.com/en-in/kb/947032
This resolved my port issue.
A simple way to fix this is to change the XAMP port to a random number.
The solution by "Mark Seagoe" worked for me too.
I got a message that "Port 443 in use by Unable to open process with PID 14508".
So i opened task manager and killed this process 14508. This was used by my previous xampp version and it was orphaned.
so no need to change any ports or anything, this is a simple two step process and it worked .
STEPS
Un-install apache(xampp) software from your windows.
Delete the xampp folder from c folder.
Delete the folder from recycle-bin to permanently delete the xampp folder
Restart your computer.
Finally install a clean copy of apache(xampp) software.
(By Engineer Rafiq Ahmad Qureshi)
qureshi.rafiq111#gmail.com

errors attempting to start Apache through XAMPP

This is what shows up when I attempt to run Apache without Apache service being activated:
>Status change detected: running
>Status change detected: stopped
>Error: Apache shutdown unexpectedly.
>This may be due to a blocked port, missing dependencies,
>improper privileges, a crash, or a shutdown by another method.
>Check the "/xampp/apache/logs/error.log" file
>and the Windows Event Viewer for more clues
This is what happens when I attempt to install the Apache service:
>Installing service...
>Apache Service detected with wrong path
>Change XAMPP Apache settings or
>Uninstall/disable the other service manually first
>Found Path: ERROR: Not Able To Open Service Manager
>Expected Path: "c:\xampp\apache\bin\httpd.exe" -k run service
>Successful!
...followed by attempting to start Apache after the service (failed) attempt:
>Attempting to start Apache service...
>System Error. Code: 5.
>Access is denied
Does anyone know what's going on here and/or are able to help troubleshoot?
I've already uninstalled and reinstalled with and without (zip file extraction) the installer.
It sounds like something may be running on port 80 already. What happens when you run
netstat -an |find /i "listening"
from the command line?
I had those messages as well. You probably have IIS and XAMPP clashing at port 80. You can either:
disable IIS (if you are not going to run the server regularly).
change XAMPP default ports.
change IIS default ports.
To change XAMPP default ports
Open your XAMPP\apache\conf\httpd.conf file and change the "80" ports to something else, people like "8080".
Open your XAMPP\apache\conf\extra\httpd-ssl.conf file and change the "443" ports to another number.
It should make both services run without conflicts.

Succeeded installing but could not start apache 2.4 on my windows 7 system

I am attempting to install and run apache 2.4 on my windows 7 system
I went to the apache 2.4 bin directory and ran the following:
Note: I opened the cmd window as administrator.
C:\Apache24\bin>httpd.exe -k install
Its output was as follows:
Installing the Apache2.4 service
The Apache2.4 service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.
(OS 10013)An attempt was made to access a socket in a way forbidden by its acces
s permissions. : AH00072: make_sock: could not bind to address [::]:80
(OS 10013)An attempt was made to access a socket in a way forbidden by its acces
s permissions. : AH00072: make_sock: could not bind to address 0.0.0.0:80
AH00451: no listening sockets available, shutting down
AH00015: Unable to open log
So it installed apache 2.4 as a service but it could not be started. It seems like the localhost port 80 is being used. Is this what "[::]:80" means?
I then stopped both the the apache 2.0 service which I had left running and the mysql service, hoping stopping one of them might free up localhost port 80.
I also run netstat -o to see if port 80 is being used. It was not.
But, I then found that a process was using the above socket it is a process that is listening on the above socket
TCP [::]:80 User-PC:0 LISTENING 4
I then ran tasklist and found out that System is using pid 4. 4 is under the pid column
System 4 Services 0 544 K
Finally, from the failed attempt to start the service
I got an error which was recorded in windows systems events.
Log Name: System
Source: Service Control Manager
Date: 2/21/2013 1:58:03 PM
Event ID: 7024
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: User-PC
Description:
The Apache2.4 service terminated with service-specific error Incorrect function.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Service Control Manager" Guid="{555908d1-a6d7-4695-8e1e-26931d2012f4}" EventSourceName="Service Control Manager" />
<EventID Qualifiers="49152">7024</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x8080000000000000</Keywords>
<TimeCreated SystemTime="2013-02-21T18:58:03.723988900Z" />
<EventRecordID>87756</EventRecordID>
<Correlation />
<Execution ProcessID="560" ThreadID="7596" />
<Channel>System</Channel>
<Computer>User-PC</Computer>
<Security />
</System>
<EventData>
<Data Name="param1">Apache2.4</Data>
<Data Name="param2">%%1</Data>
</EventData>
</Event>
The error from the attempt to start says that beacause of lack of access, make-sock could not bind to sockets which to me looked like localhost port 80. For example,
(OS 10013)An attempt was made to access a socket in a way forbidden by its acces
s permissions. : AH00072: make_sock: could not bind to address [::]:80
Can anyone tell what I am doing wrong?
Sorry for the belabored question. To solve my problem I just told apache 2.4 to listen to a different port in httpd.conf. Since System was using pid 4 which was listening on port 80, I did not want to explore this any further.
I put the following into httpd.conf.
Listen 127.0.0.1:122
The most likely culprit is Microsoft Internet Information Server. You can stop the service from the command line on Windows 7/Vista:
net stop was /y
or XP:
net stop iisadmin /y
read this
http://www.sitepoint.com/unblock-port-80-on-windows-run-apache/
I have the same problem too, after upgrading win7 to win10.
then I check services.msc and found "World Wide Web Publishing Service" was running automatically by default.
So then I disabled it, and running the Apache service again.
Port 80 maybe used by Microsoft HTTPAPI
Try to stop the following service:
Web Deployment Agent Service
SQL Server Reporting Service
SQL Server VSS Writer
I solved this issue finally, it was because of some systems like skype and system processes take that port 80, you can make check using netstat -ao for port 80
Kindly find the following steps
After installing your Apache HTTP go to the bin folder using cmd
Install it as a service using httpd.exe -k install even when you see the error never mind
Now make sure the service is installed (even if not started) according to your os
Restart the system, then you will find the Apache service will be the first one to take the 80 port,
Congratulations the issue is solved.
In my case, it was due to an IP address that Apache is listening to. Previously I have set it to 192.168.10.6 and recently Apache service is not running. I noticed that due to My laptop wifi changed recently and new IP is different. After fixing the wifi IP to laptop previous IP, Apache service is running again without any error.
Also if you don't want to change wifi IP then remove/comment that hardcode IP in httpd.conf file to resolve conflict.
if you are using windows os and believe that skype is not the suspect, then you might want to check the task manager and check the "Show processes from all users" and make sure that there is NO entry for httpd.exe. Otherwise, end its process. That solves my problem.
So, that is why i do a two (or more) post.
I was having the same problem when starting the service (logs can not be opened).
I thought it was because i was trying to have htdocs inside a VeraCrypt encripted container, absurd since i hace such contained mounted and i use a juntion to not affect paths.
The i read the cause could be low ram: after some tests i get to the next conclusion.
Windows is not sending pages to virtual ram to free enough ram if it is a service, for applications it is doing it, i have more than 200GiB of pagefile ready to be used as virtual ram in a 4GiB 64 Bit windows 10.
My solution:
Run a free utility that free ram (512MiB in my test)
Inmediatly after start the service, it starts with no errors
Real Cause:
I was using a virtual machine that uses 1/2 physical free ram (1.5GiB)
Hope this help others.
I was also facing the same issue, then i tried restarting my system after every change and it worked for me:
Uninstall Apache2.4 in cmd prompt (run administrator) with the command:
httpd -k uninstall.
Restart the system.
open cmd prompt (run administrator) with the command:
httpd -k install.
Then httpd -k install.
Hope you find useful.
you can solve it
sudo nano /etc/apache2/ports.conf
and changed Listen to 8080
This may be because of shortage in physical RAM.
Check minimum system requirements in the docs and try to close unnecessary programs if possible.

Apache Can't start because of a make_sock bind to address error on port 80

I have noticed a new thing going on with my server that I can't quite figure out what is making it happen. I'm hoping someone out there has experience with this problem and can help me find a solution to get it to stop.
I did a reboot on my ubuntu server tonight that I have running at slicehost.com. Everything runs great until I go to start apache. I get the following error.
* Starting web server apache2 (98)Address already in use: make_sock:
could not bind to address 0.0.0.0:80
no listening sockets available,
shutting down Unable to open logs
...fail!
A little further research using netstat -ltnp | grep ':80' will show the following:
tcp 0 0 0.0.0.0:80
0.0.0.0:* LISTEN 3948/apache2
I can then kill 3948 and apache starts up like normal. The PID 3948 keeps changing to a different number.
This is new and the only thing I have done since I had a successful boot without this happening was uninstalling a manual install of phpmyadmin and then re-install it using the aptitude install commands. Phpmyadmin now runs fine on the server but I don't understand what this error means or how I can go about getting it resolved.
Anyone that might offer some insight would be greatly appreciated!
Check If you don't double-start your server, and if your partitions are already mounted, so it can access its log files.
I advice to restate that question on serverfault.com, your question is slightly misplaced here.
The problem is because port 80 is already in use (probably IIS7 use it). To solve problem open Apache/conf/httpd.conf file and find line Listen 80 and change it to another port (eg. Listen 5555). Than run httpd.exe and try to open localhost:5555. It works! :)