Xampp's APACHE not working? - apache

I have installed/reinstalled Xampp server on my laptop for a million times now, and still Apache is not running. At first, it will Run, but few moments later it will automatically stop. I don't know what seems to be the conflict. I have checked my Skype since I once met a conflict on the port usage but in this case, I haven't installed Skype. Can someone please guide me on how to make my Apache run successfully. Note that my mySql runs smoothly, only Apache won't. Please help..:(
P.S.
When I run my xampp-control panel, mySql runs smoothly whereas Apache will run for a moment and then will stop, below in the control panel, it will then say apache[port 80] is busy.

What caused this problem on my system (Windows 7) was that the WinHTTP Web Proxy Auto-Discovery Service had stopped running. In the Services part of the Computer Management feature (i.e. the app that runs by selecting Manage from the right-click menu on the Computer link on the Start Menu), I found that WinHTTP Discovery Service was set to 'Manual'. I left it as 'Manual', but started it, and Apache began working again.
Even though I didn't change the 'Manual' nature of the service's startup, I discovered that, after Windows reboot, the WinHTTP service was still running (which was a bit puzzling to me, but there we are). I also don't know what caused this service to stop running on my machine ('but there we are' again!)
Anyway, it seems that having WinHTTP Web Proxy Auto-Discovery Service running is necessary for Apache to run, so make sure it's running!
EDIT TO ADD: I found the root cause of my problem: I'd downloaded a free game that uses Pando (peer-to-peer file sharing app) to allow others to download the game from my machine too (which, in principle, I was okay with), and it uses TCP port 443, which was stopping Apache running. I assume (though really don't know enough about networking to be sure) that the running of the WinHTTP Web Proxy Auto-Discovery Service mentioned above was managing to share (or otherwise work around) the use of port 443.

Open a cmd as Administrator (Start -> "cmd" -> right-click "cmd.exe" -> Run as Administrator)
Type
netstat -nab
Find the line that says
TCP 0.0.0.0:80
well or basically every line that ends with :80
See the exe that's blocking the port above the line.
Terminate the associated program - if nothing else works the Task-Manager should help.
EDIT: Usually IIS would block Port 80 if it is started. There are quite a lot of other programs that could block port 80 though. You can also try and
telnet localhost 80
and see what kind of service answers. Or... use a webbrowser. Or... configure apache to use a different port (but who wants to do that?)

Reconfigure Apache to run on a different port
You might want to pick this path if you don’t want to close the application blocking port 80. A typical reason might be that you want to run say, Apache and IIS on the same machine at the same time.
To configure Apache to run on a different port, goto this path "C:\xampp\apache\conf" (if you install Xampp on diffrent place then navigate to this path) and open httpd.conf in notepad. Search for the following lines:
Line 1 : Listen 80
Line 2 : ServerName localhost:80
Change both these lines, so as to have a different number instead of 80. I have chosen 8000 instead of 80. Make sure that this is a free port, not used by any applications.
Line 1 : Listen 8000
Line 2 : ServerName localhost:8000
Save the file and run Apache from Xampp

Try disabling your Anti-Virus software temporarily. It's known to cause Apache problems. Also check Apache error.log file to see if it has recorded any issues.
Also try some other WAMPs to see if it's a common problem on your system.

Skype automatically blocks the port 80
Stop Skype - Try the apache to start from xampp dashboard
If apache Works - change skype settings

1) In the system tray, we click on the xampp icon.
2) Select Apache> httpd.conf
3) Make a call to Listen 80.
4) Change the number 80 next to Listen to 9080.
5) Restart XAMPP's services

Related

How to resolve service problem in xampp with Apache?

Whenever I click on apache service to start in xampp server it gives me error.
Please help me out.
XAMPP control panel
Without a proper log, I cannot tell you the exact problem. Most probably your port 80 is using by other service
Considering port blocked, you have two available options
stop the service which is using port 80
run cmd as administrator and run below command. It will ask you whether you want to run this, give Y
net stop http
change port 80 in Apache
stackoverflow

Accessing localhost (xampp) from another computer

First, I already searched stack overflow and followed the suggestions in previous answers, such as How do I connect to this localhost from another computer on the same network?
I have created a PHP/MySQL application for a client. The want to host it locally on that server.
The machine in question is running an application written in another langauge (I'm not sure which one) and running Tomcat on port 8080.
They also do not have separate staging/production environments, so this is not ideal.
Their other web application needs to remain running while I also port over the new app. I installed XAAMP onto their system and got the app running locally using Apache HTTP. However, they want other computers both within and outside their networks to be able to connect to the Windows server as well. They are already doing this for the previously created app that is running on Tomcat.
Ports 80 and 8080 are already being used, so the firewall was updated to allow my application to run on port 8086.
I used ipconfig to the find the local IPv, and then tried updating the http.conf and vhost file and am listening to the IP on port 8086. However, going to the IP/foldername doesn't resolve on another computer in the network. As a test, I also just typed in the IP of the windows machine, and it never resolves.
I generally don't implement of windows; until now, all of my production applications have run on some flavor of unix. Their other application is live and I don't want to disturb it. They access it by going to {servername}:8080. I tried server:8086 to see if my app could be accessed that way, but it can't.
I confirmed that localhost/foldername resolves.
Here are the exact steps that I have taken. I tried two different solutions.
Solution 1, using How do I connect to this localhost from another computer on the same network? as a guide:
Make sure firewall allows port 8086 access
I modified the C:\xampp\apache\conf\extra\httpd-vhosts.conf file to include a virtual host for the application:
DocumentRoot "C:/xampp/htdocs/{foldername}"
ServerName dispatchserver
Went to the Windows host file located at \Windows\system32\drivers\etc\hosts and added the following:
192.xxx.x.xx dispatchserver
From a computer outside the network, tried to go to the following URLs (non resolved):
http://192.xxx.x.xx
http://192.xxx.x.xx:8086/
http://192.xxx.x.xx/foldername
http://dispatchserver
http://dispatchserver/foldername
Since they didn't work, I tried a solution using this older stack overflow answer: Accessing localhost (xampp) from another computer over LAN network - how to?
Made sure firewall allows port 8086 access
XAMPP control panel > Config > Service and Port Settings > Apache > Changed main port to 8086.
XAMPP control panel > Apache > Config > http.conf
Searched for "Listen 80" and replaced with Listen 8086
Right above that, added Listen 192.xxx.x.xx:8086 (I used the IPv4, but don't want to include full address for security reasons). I added this line with hashtag at first (#192.xxx.x.xx:8086) and then without hastag after that didn't work (192.xxx.x.xx:8086).
Searched for and set this up as the directory statement:
AllowOverride All
Require all granted
Restart Apache
What steps can I take to allow the new webapplication I installed via XAMPP to be accessible to other computers?
In that case it's a little different if you want to web enable this. You need to set up your router to port forward to your server (app)so that the other network can reach it from the internet. Your router blocks incoming requests by default so a port forwarding rule using the port you mentioned will work. You should also put your server computer (the one with the app) on a static ip address to make things easier. Then for the user to see your app you need to give them the ip address of your internet connection (seen via sites like ipchicken.com) and the port number in the url.
Normally you just need to open the ports in the windows firewall on both computers (inbound and outbound) for the ports your application is using and then connect to the other machine via ip address and port number if they are on the same network.

Port 80 is blocked by 'System'

I'm trying to run a portable Xampp webserver to work on a website, but I noticed that on my main computer (other computers haven't had this issue, but I can't use them much and I want to fix this problem instead of avoiding it so it's gone next time) Apache won't run, so I did a portcheck and port 80 is used by 'system'. I included a screenshot, as you can see everything else is free but port 80 is being used.
So, does anyone have any ideas how I can fix this? Finding a way to open port 80 or how to change Apache http to another port are both options, but I don't know enough about apache to trust myself not to completely screw it up and I don't know how to clear port 80.
There are a few similar questions I've found, links here, here & here but none of them give me the answers I need.
Your system might have IIS service. which uses 80 port. you need to stop that service. try following command in cmd as administrator:
iisreset /stop
If you are using skype.. u should check its connections settings and remove the port 80 from it.
On my side, I had to stop "Windows Sync Share" service on windows server 2012. Then I could use the port 80 and use Apache Tomcat 8.

XAMPP - Port 80 in use by "Unable to open process" with PID 4 - Windows 10 [duplicate]

I've tried deleting skype but that didn't work, I've tried turning off the world wide web thing off, IIS off nothing seems to work.
12:51:22 PM [Apache] Problem detected!
12:51:22 PM [Apache] Port 80 in use by "Unable to open process" with PID 4!
12:51:22 PM [Apache] Apache WILL NOT start without the configured ports free!
12:51:22 PM [Apache] You need to uninstall/disable/reconfigure the blocking application
12:51:22 PM [Apache] or reconfigure Apache and the Control Panel to listen on a different port
Open a CMD prompt as administrator and execute the following command:
net stop was /y
Open the Run dialog box (press Win+R), then type: services.msc
Then search for World Wide Web Publishing Service (WWW-Publishing Service) and Web Deployment Agent Service and stop them. You should also disable them.
Start Apache again with XAMPP :)
Link Ref: https://www.sitepoint.com/unblock-port-80-on-windows-run-apache/
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.
Now it avoids Port 80 and uses Port 8080 instead without issue. The only additional thing you need to do is make sure to put localhost:8080 in the browser so the browser knows to look on Port 8080. Otherwise it defaults to Port 80 and won't find your local site.
This will also require you to restart Apache for the change to take effect.
Voila! Fixed.
In httpd.conf change the following lines and then restart the application:
Listen 80 to Listen 8080
ServerName localhost:80 to ServerName localhost:8080
When you press "Start" the application can still say that you have an error like "Port 80 in use by "Unable to open process" with PID..." but it will still work.
If the error includes "Port 443 in use by "Unable to open process" with PID..." you need to change both httpd.conf and httpd-ssl.conf.
In httpd-ssl.conf change:
Listen 443 to Listen 4433
<VirtualHost _default_:443> to <VirtualHost _default_:4433>
ServerName www.example.com:443 to ServerName www.example.com:4433
Extracted from this article:
Go to your run command and enter:
netstat -o -n -a | findstr 0.0:80
The last number here is the process ID using it. This is most often IIS or other web relates service and is easy to resolve, but every so often (very often it would seem looking around on google) it appears to be PID 4 – which according to the Windows Task Manager is the NT Kernel and System. Not very helpful given killing this will result in a blue screen of death.
The thing hogging port 80 has nothing to do with IIS or web anything, it's SQL Server Reporting Services. Turn off anything that resembles a SQL Server Services and start Apache again, no need for a reboot.
So problems with PID 4 listening to port 80? Check your SQL services and turn them off.
UPDATE -
Comment from #sangam:
Worked at a shot. In my case, it turned out to be SQL server reporting
services. I stopped the service for all the installed instances, and
it worked (without machine reboot).
So I have faced the same problem when trying to start Apache service and I would like to share my solutions with you.
Here are some notes about services or programs that may use port 80:
Skype: Skype uses port 80/443 by default. You can change this from Tools -> Options -> Advanced -> Connections and disable the checkbox "use port 80 and 443 for addtional incoming connections".
IIS: IIS uses port 80 be default so you need to shut it down. You can use the following two commands: net stop w3svc, net stop iisadmin.
SQL Server Reporting Service: You need to stop this service because it may take port 80 if IIS is not running. Go to local services and stop it.
VMware Workstation: If you are running VMware Workstation, you need to stop the VMware Workstation server - port 443 as well.
These options work great with me and I can start Apache service without errors.
The other option is to change Apache listen port from httpd.conf and set another port number.
Hope this solution helps anyone who faces the same problem again.
You might need to stop the "Web Deployment Agent Service"
Press Win+R and type services.msc
Right click on Web Deployment Agent Service and select "Stop"
Restart XAMPP
Also after double clicking "Web Deployment Agent Service" you can make the Startup type to Manual, So that "Web Deployment Agent Service" will not start automatically
As there is comment by #johnkarka on the question, this port is used by SQL Server reporting service as well. After stopping this, Apache started fine.
Go to "SQL Server Configuration Manager"
Click on "SQL Server Reporting Service" and stop it
The funny thing is IIS was working fine in same configuration but not Apache, had to stop SQL Reporting service to make it work on default port (80).
After changing the main port 80 to 8080 you have to update the port in the control panel:
Then click here:
And here:
Then save and restart.
Open Task Manager (Ctrl+Alt+Delete).
Go to "Details" tab.
Sort by PID number.
End process that is using PID number indicated in error.
Restart XAMPP.
What worked for me was stopping the Internet Information Services (IIS). If you are using Windows 7, click on your Start button and in your search box, type "iis". Click on "Internet Information Services (IIS) Manager". When the window pops up, and assuming you've got none of the icons selected, you should just be able to click Stop on the right action pane. My XAMPP Apache started right up. Hope it all worked out for you.
In windows 10, to free up port 80:
in my case, I open "Services" from "Search Windows" (on the left corner on screen), then stop all of SQL server services MSSQLSERVER and it works again
I had this problem too and stoping services using port 80 didn't helped. I resolved it by following this procedure (found on a french board):
Launch RegEdit
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP
Change the value of "start" to 4 (disabled)
Reboot your computer
Not sure how this affect other services, but it solved permanently the issue and so far I didn't see any issue.
Using Windows 10.
If you've SQLServer Reporting Services running locally then you need to stop that also..
I've had the same problem, but in my case Apache was already running and for some reason the XAMPP config tool didn't show that. It happened after I started XAMPP for the first time after the installation. After crashing the other Apache instances all was fine and ports 80 and 443 were free again.
So before making changes to your systeem, make sure something as obvious as the above isn't happening.
"SQL Server Reporting Service" was causing issues in my system, after stopping it, Apache started working fine
I have the same issue, I solved the problem, just disabled
"BranchCache Service" in services.
Somehow windows updates, this service is triggered in startup, and uses 80 ports. When you check via netstat you could see the system is used this but couldnt understand which service is used.
Click services on the Xampp control panel (filename is services.msc, extra info).
First, look for IIS, if it is running. Stop it (stop this service option on the left after clicking on the service name.). Then, this is the main problem, Look for Web deployment Service (not the exact name though it has Web deployment at the beginning.). Stop this service too. Try again and Apache should work.
If you are running Skype, exit out of that too, run Apache, then launch Skype
I've had same problem, when I was installed MS WebMatrix, IIS Server was blocked the port 80 which XAMPP was running on. I tried to find World Wide Web Publishing Service and stop it, but could not find it on list. Best way is changing a port.
Please refer with this
link ref.
For those with ASP.NET, C# or having SQL Server users, If you are using SQlServer OR Visual Studio Your port might encounter. easiest thing you might want to do is on Command> servies.msc and then find SQl Server Reporting Service and then stop it.
if the service is http.sys
You need to change the binded IP address for http.sys
netsh http add iplisten ipaddress=::
Work fine without restart the os.
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.
Uninstall it solved my problems!
For me usually works:
- Turn off Skype
- Turn off all SQL Server processes displayed in services.msc
- Turn off World Wide Web Publishing in services.msc
It usually works afters you stop IIS Server and Skype
XAMPP - Port 80 in use by “Unable to open process” with PID 4! 12
run the comment in cmd tasklist
and find which the PID and process name related to this now open window task manager
you can also open window task manager by using CTRL+ALT+DEL
now click on the process tab and find the name which using PID and right click on that and
end process
now again restart the xampp
I had same issue. After some googling arrived to this page. Since I guess this error may have various reasons, so listen to my experience:
Xampp red line log:
12:53:54 PM [Apache] Problem detected!
12:53:54 PM [Apache] Port 443 in use by "Unable to open process" with PID 3908!
...
Finally it turned out that I had this line of code in my php codes :
$res = file_get_contents("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
The purpose of this piece of code was to get a mirror of php result from somewhere in my server. But it's just stucked in a loop that gets its own content!
I repaired code:
$res = file_get_contents(str_replace("my_uri.php" , "mirror_uri.php" , "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"));
Then I restarted apache ... and that apache error never happened again.
So sometimes searching for probable halting points in your code is a good approach.
In Ubuntu by default, the system will not allow you to occupy privileged ports [ 0 to 1023], other than specifying the port as 80, you need to run XAMP with sudo.
I write this, because i coudn't find answear for the same question.
In my case PID was 2484.
you must find a process or service with this PID:
open cmd (in Windows) and write:
tasklist
Find your PID in this list and read name of process or service.
Now you can kill this using Task Manager
find this name on Process list
click End Process.
That's my case. Possibly you must open services.msc and stop Service with your PID.
On my computer xampp it worked fine :)

Apache will not start due to Port 80 in use (all obvious solutions already went through)

I was hosting 3 websites from my home server with IIS and due to all of the issues I ran into like sendmail with a php script, I completely uninstalled IIS from Server Manager and installed xampp. I am using Windows Server 2012 R2. Apache will not start due to port 80 being used. I have already tried many of the fixes scattered across the web. Things I have tried:
-Web deployment agent Service has been disabled
-World Wide Web Publishing service is not on any list of services for my PC-Skype is not installed on my PC-MSSQL Server Reporting Services is disabled - I have ran netstat -aon | findstr :80 an serched for all prosesses with port 80, and PID 4 which is NT Kernel & System.
This is where I am stuck, I can not for the life of me find out what is using port 80. I know I can change apache's listening port to 8080 or whatever but I do not want to do that as the URL would have to show that. Is it possible I could have a virus? Are there other ways to narrow down what could be causing this?
Probably the easiest thing to do is point a browser at your server and see what pops up. Sometimes a shutdown and then a restart (not a restart from the Start button, but an actual shutdown) helps clear up various M$ server issues. Good luck!