I'm a beginner in PHP. When attempting to start Apache using XAMPP, I saw the following error messages in my log:
11:42:18 AM [Apache] Problem detected!
11:42:18 AM [Apache] Port 80 in use by "Unable to open process" with PID 4!
11:42:18 AM [Apache] Apache WILL NOT start without the configured ports free!
11:42:18 AM [Apache] You need to uninstall/disable/reconfigure the blocking application
11:42:18 AM [Apache] or reconfigure Apache and the Control Panel to listen on a different port
11:42:18 AM [Apache] Attempting to start Apache app...
11:42:19 AM [Apache] Status change detected: running
How to fix these errors?
If you're running "Skype" from Microsoft, close it.
No just from the window, right click close/exit on the skype icon on the taskbar (in your clock) or kill the moth*** process in the task manager if you've been stucked for a while with this (it gave me some relief a few years ago), if works open skype and kill it again just to be sure.
If you're not running skype, try something from here:
http://www.sitepoint.com/unblock-port-80-on-windows-run-apache/
If you didn't click I will quote the article here:
The Obvious Candidates
There are a number of well-known Windows programs which use port 80:
IIS 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
SQL Server Reporting Services SSRS can remain active even if you
uninstall SQL Server. To stop the service:
Open SQL Server Configuration Manager.
Select “SQL Server Services” in the left-hand pane.
Double-click “SQL Server Reporting Services”.
Hit Stop.
Switch to the Service tab and set the Start Mode to “Manual”.
Skype Irritatingly, Skype can switch to port 80. To disable it, select
Tools > Options > Advanced > Connection then uncheck “Use port 80 and
443 as alternatives for incoming connections”. What’s Using Port 80?
Further detective work is necessary if IIS, SSRS and Skype are not to
blame. Enter the following on the command line:
netstat -ao
The active TCP addresses and ports will be listed — locate the line
with local address “0.0.0.0:80″ and note the PID value.
Now right-click the task bar and select Start Task Manager. Navigate
to the Processes tab and, if necessary, click View > Select Columns…
to ensure “PID (Process Identifier)” is checked. You can now locate
the PID you noted above. The description and properties should help
you determine which application is using the port.
The Task Manager allows you to kill the process, but be a little wary
about doing that — especially if it’s “NT Kernel & System”.
Microsoft-HTTPAPI/2.0
NT Kernel & System is an essential service. Stopping it will probably
stop Windows in a blue-screeny-like way. Therefore, enter the
following at the command line:
telnet 127.0.0.1 80
If you’re faced with a blank screen, type “GET” and hit return. The
chances are, you’ll see a line stating that Microsoft-HTTPAPI/2.0 is
listening on port 80. If that’s the case, open Services from
Administrative Tools and locate “Web Deployment Agent Service”. Stop
the service and set it’s startup type to “Manual”.
The Web Deployment Agent Service is deployed with WebMatrix and was
the cause of my woes. It may also be distributed with other
applications installed using Microsoft’s Web Platform Installer.
That caused me a few frustrating hours so I hope it solves your Apache
or WAMP start-up problems.
If you enjoyed reading this post, you’ll love Learnable; the place to
learn fresh skills and techniques from the masters. Members get
instant access to all of SitePoint’s ebooks and interactive online
courses, like PHP & MySQL Web Development for Beginners.
Stop all apaches and any web-servers you already running and then run xampp with admin privileges (click right button on app).
Open Service Control Manager [Start -> "services.msc" (enter)] and Stop the Following services if they are enabled and are not important you.
World Wide Web Publishing Service (IIS)
Web Client
Web Deployment Agent Service
Also check for applications like (Since PID is 4, the service must be from Microsoft so this is rare)
Skype
TeamViewer
VMWare Products (In very rare case, if you have configured)
Related
I got some trouble with my xampp on Win 10, as so many have had before me...
It's the same old port problem with skype and IIS.
I used to quit skype and stop the world wide web publishing service, but am sick of having to go through the whole ordial every time I start xampp.
so yesterday I changed the ports for my apache server and ecerything worked fine.
started up today and boom...localhost couldn't find my pages.
So I checked for port problems in xampp...there were none! apache was up and running(as were mysql server and filezilla). no error messages, nothing.
I resetted the ports to 80 and 443. killed of skype and the iis and everything worked fine again. Now whenever I change the ports, it will not run.
I did everything according to here:
How to change XAMPP apache server port?
(I changed the ports in httpd.conf, httpd-ssl.conf and in service and port settings )
I just don't get it. why it won't run with changed ports(and yes I checked the ports for being empty).
atm I have changed the port 80 -> 8024
and port 443 -> 1337 (no matter what I change this port to it always throws bad request)
8024 works fine. I can get to the dashboard via localhost:8024
but localhost:1337 gives me a bad request.
any suggestions, or similar encounters?
For now will have to continue using standart ports and kill of the 2 processes, but I really wanna skip that in the future.
I used port 80->8024
and port 443->448 yesterday and it worked fine...really weird...
Ok so that means your system has Microsoft IIS installed or one of the other bits of MS technology that reports that signature, they are doing that on later versions of Windows for some reason.
If you are not intending to use it you can uninstall it, it is not an integral part of windows so its being uninstalled wont effect normal operations of windows, and if you need to install it again later, it comes as part of the standard OS so you wont need to do anything perticularly clever.
So go to Start -> Control Panel -> Programs and Features
Click the 'Turn windows features on and off' link in the left hand menu.
Wait for the list to load and then find 'Internet Information Services'
Un check the check boxes for the following items ( you may not see all of them ), and there may be others I done know about. You may have all of these or just some of these.
IIS
Web Deploy 2.0 (Web Deployment Agent Service)
MS Sql Server Reporting service.
BranchCache ( Windows 8.1 )
SQL Server VSS Writer
List of possible service names not sure how up to date this is.
Tutorial on how to find what ports are in use on your system and what app is using them
Windows will then have a think for a while and then remove those applications, you will probably be asked to reboot to complete the uninstalls.
Reboot anyway when the uninstalls are complete.
Then try XAMPP again
I am new to php and I would like to run a local testing server using easy php at home to work on school projects but when I try to start the easy php server, this error message pops up: Apache port (80) is already used by another application ! Close this application and try to run again the server It then gives me some instructions on how to close the application (by killing processes of selected ports), but when I right on the selected ports, the kill processes option is faded and not clickable. Maybe there something else I need to check or do on my computer to run this local host? Thanks for all help!
Just a shot in the dark but maybe try to close Skype, if you have that running, and then start the server? If I remember correctly Skype listens on port 80 by default. If that's indeed the issue then you can configure Skype not to listen on port 80 in its settings...
That might be related to Skype or the IIS server using port 80. You can configure Skype to use different ports in the preferences. You might try going to "localhost" in your browser and see what comes up as well. If it shows a Microsoft IIS server page then you know that the server is running. Disabling that or turning that off depends upon your operating system. You can probably just look that up on the internet if that is the issue.
I've got a Windows 7 XAMPP setup that I use for quickly testing PHP code. I have been running tests with a PHP WebSocket script I wrote recently, and it works fine on every port I've tested except ports 80 and 443. Neither 80 nor 443 will work with the ws or wss protocol. When I try either port, absolutely nothing will go through and the script will just sit there running forever.
The official WebSocket spec (RFC 6455) states:
The WebSocket Protocol attempts to address the goals of existing
bidirectional HTTP technologies in the context of the existing HTTP
infrastructure; as such, it is designed to work over HTTP ports 80 and
443 ...
And:
By default, the WebSocket Protocol uses port 80 for regular WebSocket
connections and port 443 for WebSocket connections tunneled over
Transport Layer Security (TLS) [RFC2818].
And:
The port component is OPTIONAL; the default for "ws" is port 80, while
the default for "wss" is port 443.
So how am I supposed to get ports 80 and 443 to work?
Thanks.
Edit: Here's the first line of netstat:
I guess that means that I can't use port 80, right?
Typically, this sort of issue would mean one of the following:
Something is already listening on those ports; port bindings cannot be shared by multiple processes.
You may require escalated privileges and don't have permissions to open up a listener on those ports (lower-range ports are usually reserved).
To see if it's the first issue, try using netstat to see what ports you have listeners for:
netstat -a -p TCP -o -n
If it's the second issue, you may have to adjust the way you're running the server so it has the proper permissions.
There may be a workaround (I haven't tried this) to enable port sharing under Windows:
https://msdn.microsoft.com/en-us/library/ms733925(v=vs.110).aspx
...but the behavior may be hard to predict with that sort of setup. Another option is to set up a proxy in IIS (which I assume is what's hogging your port 80).
This answer was last revised on November 20, 2015 at 2 PM EST.
I discovered your question because it is similar to my own during the set up process to install and configure XAMPP on my Windows 10 laptop.
(I will explain in details what happened in my specific situation below, but before that I will put a very quick summarized answer to your question.)
I ran the XAMPP as administrator via right clicking it and choosing that option.
The port problems disappeared seemingly.
Now I can open it normally by left clicking it from the pinned icon on the taskbar without specifying administrator.
The latter result occurred after restarting my computer several times in a 24 hour period.
Wish I knew precisely what changed and how it worked, but it's working perfectly now as far as I can see.
I received some errors in the XAMPP Control Panel on November 17, 2015.
These errors said things similar to the following:
"unable to open process PID 4416"
"port 80 blocked"
"port 443 blocked"
"you are not running as an administrator"
Also, I should mention, that I am working through the steps in Chapter 2, Setting Up a Development Server, in the O'Reilly published text book 4th Edition of Learning PHP, MySQL, & JavaScript With jQuery, CSS, & HTML5 by Robin Nixon.
I also discovered that a command prompt "looking" box had opened which I did not know what to do with, and so I later closed it.
However, to get back on point, specifically it was important to me to set up with server and run it in as similar a way to the text book instructions as possible, so changing default port numbers did not appear to be a good option for me because I was not sure how alter the port number for one thing, such as the main port, might affect other ports, and other things on down the line.
I also was getting a bit confused by some other advice offered about searching, using various methods, to determine what other "things" might be interrupting the ports that my XAMMP was trying to use, akak my Apache server.
It actually appeared as though Apache was the source of the PID 4416, and that nothing was utilizing Port 80 or Port 443 at all. I also checked to see if Port 3306 was being used, because it is mentioned in the text book that it would be the default Port for MySQL, and it was not being used by anything else.
I check these PIDs by going to "Task Manager," then to "Details," then to "PID."
Then, in my Windows 10 laptop, I closed all open windows of any kind, even the XAMMP Control Panel.
Then, I typed XAMMP into the "Search Windows" bar.
When XAMMP appeared, I right clicked on it and chose to run it as Administrator.
When the Control Panel opened in this method, I received no error messages in the Control Panel for XAMMP.
However, when I pinned XAMMP to my task bar and tried to open it in a normal fashion (left-click to open) I received many errors.
But, when I right click on the pinned XAMMP icon on my task bar, and then right click again when the words XAMMP pop up, and then choose "run as administrator" it seems to be error free.
This is a work around type of solution.
I assume it might be helpful to some, but not all.
I hope it helps to shed light on similar issues.
I will be working to solve this completely.
It seems in this particular case I need to find a way to be sure the XAMMP automatically runs as adminisistrator when opened, and must require some adjustments that I simply have not discovered just yet.
I hope this is helpful to others! :)
Most of my knowledge is based in HTML5 and CSS3 and search engine optimization, and so I am working to learn more about server side, and dynamic / interactive scripting at this time.
P.S. Within 24 hours of this initial problem, after several restarts of my laptop, I was able to open XAMPP without error, in a normal fashion, by simply left clicking on the icon that I pinned to my taskbar.
I hope this is helpful as well. :)
Have a great day.
I have encountered a problem when trying to preview PHP files using the Xampp control panel Apache module. Basically I open the control panel, click 'start', and have it minimised on my screen. I then navigate to a PHP page that I want to preview in my browser - but when I try to load it, it just sits there and says 'Waiting for Localhost' on the tab. The page never loads. Has anyone ever encountered this problem before, and if so, is there a simple fix?
Regards,
Robert Young
This happened to me and the problem was that some other application was listening on port 80. I couldn't figure out what it was. Usually, it would be Skype so I shut down Skype and I still had a problem connecting to localhost. The other application was Audible Download Manager which automatically starts when I start windows and you can usually see in the windows task manager. Once I closed the app, localhost started working.
This is how you figure out which application is listening on port 80.
Go to Start, then Run or type cmd and open cmd.exe. Then type:
cd desktop
netstat -a -b -p TCP >port_list.txt
After command runs, port_list.txt will be saved on your desktop. Open port_list.txt and go through the list and find the application listening to :http. Then find the application under processes in your windows task manager and end the process.
I had similar issue... Here is what you can do:
Step 1: on xampp control panel checkout netstat & look if any other application is using that port as your xampp
( If yes then shut down those applications using Task Manager)
Step 2: Irrespective of Positive or negative results of step 1, Just Turn off your firewall through control panel.
In my case I just had to turn firewall off & it did the miracle.
I need to set up a local php server and downloaded XAMPP version 3.2.1 for windows. The installation finished without error messages and the control panel starts just fine. MySQL runs without problems but apache won't start.
The error message says:
12:17:01 [Apache] Attempting to start Apache app...
12:17:01 [Apache] Status change detected: running
12:17:02 [Apache] Status change detected: stopped
12:17:02 [Apache] Error: Apache shutdown unexpectedly.
12:17:02 [Apache] This may be due to a blocked port, missing dependencies,
12:17:02 [Apache] improper privileges, a crash, or a shutdown by another method.
12:17:02 [Apache] Press the Logs button to view error logs and check
12:17:02 [Apache] the Windows Event Viewer for more clues
12:17:02 [Apache] If you need more help, copy and post this
12:17:02 [Apache] entire log window on the forums
I tried various ports, apache still doesn't start. I started the control panel as administrator - I am logged into the administrator account on this machine, but there's this extra button "start as administrator"- . It doesn't work.
Unfortunately the error logs are not created. The control panel complains that it couldn't find the appropriate files, should they be created ? I clicked yes and tried to start apache again. Same error message, now the error logs are found but they are still empty.
I searched for similar problems and found this question: Apache in XAMPP won't start
The accepted answer recommends to close the windows services "WebClient" and "Web Deployment Agent Service". I've disabled "WebClient" but "Web Deployment Agent Service" is not installed. Sounds like VisualStudio which I don't have on this machine.
My guess is that my apache installation is not sane. Probably misses some dependencies. How can I check this ?
UPDATE:
It seems that although I changed the configuration files, apache still tried to run on port 80. And this port was indeed blocked by Skype. After closing skype, apache ran fine. And it was available on localhost:80 despite the fact that I definitely specified another port in the config file. #steven if you made your comment into an answer, i would accept it.
There are several reason that can cause this issue.
Skype:- Skype run on port 80 and 443 which can be a reason that block port 80 and 443 for Apache. you don't need to uninstall Skype. you can use following step if you installed Skype in your Machine.
Quit Skype before running Apache so if Skype can release port 80 and 433.
Go to Skype Tools-> options -> Advanced -> Connection and unchecked port 80 after this you need to restart your skype and try to run the xampp now it'll not throw any issue as port 80 and 443 is free to use
IIS Server:- If your Machine have IIS Server enable so this is also a problem for you because IIS server also use port 80 and 443.
Go to start Menu type Internet Information Services select this and stop it's service which will release port 80 and 443.
I got the same problem, but I finally solved it.
Have you checked your firewall?
Are any XAMPP applications and services excepted?
Then, make sure Skype is uninstalled or blocked. This application uses the ports 80 and 443.
For me, Skype wasn't the problem, but iTunes! I figured out that iTunes uses the ports 80 and 443 as well. If it still doesn't help, try installing Apache manually.
open your command prompt (run as administrator) and write the following code and hit enter
net stop w3svc
and then open your xampp and run apache server
if you want to start your w3svc
then execute this code
net start w3svc
NOTE : stopping w3svc won't lead to any problems
NOTE : Don't forget to run cmd as administrator
After checking my config files, running "net stop http" in the command line, as well as spending about 30 minutes trying to download a version of Skype that is no longer supported in order to release my ports...
What worked for me is that I needed to create an SSL certificate. I found this under xampp/apache/conf/ssl.cert directory. (Make sure to save the certificate in the "Trusted Root Certification Authorities" store when prompted). Once going through that prompt, and successfully creating the certificate. Apache began running again like normal.