port 80 for apache server is in use by PID 4 (System) and cannot be stopped

烈酒焚心 提交于 2020-01-07 02:43:06

问题


I am starting apache at port 80 with xampp. However, the port 80 is taken by PID of 4 by the name system. I have tried Taskkill /F /PID 4 to force kill the task by even using the administor's rights but access is still denied. Any idea on how to solve this problem (I don't want to change the port of apache)


回答1:


the port 80 is usually being used by this service: "World Wide Web Publishing Service", open "Services" in the Control Panel and stop it




回答2:


When I ran into the same problem of yours, I changed the apache port to 81 which is 80 by default, and it worked and I have been using since. here is how to do that. start xampp Control Panel-> click on the config button against apache -> click on httpd.conf -> look for port number and change it to a desired port -> restart xampp ->done.




回答3:


Process PID 4 is System-critical service, you cannot stop it without causing windows to stop completely.

Any of these approaches should probably fix the issue:

  • Change http.sys settings in the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\UrlAclInfo Just change http:+:80 to another port number in all keys necessary then restart your computer.

  • Find what program is using that port and use its configuration to change the port. Usually Microsoft SQL Reporting Tool uses http.sys to listen on port 80, there is a configuration manager that allows you to change that.

  • Use a different port in your Apache application.




回答4:


Nick W I had the same issue with my Asus Laptop,

In windows you can get information about the ports that are being used by some aplicacions with this commands: netstat -ao netsh http show urlacl

The Service Asus Flip Service by default uses port 80, is you stop the service it will release the port, but if you turn your laptop into the tablet mode the screen won't rotate

So if you want to use Asus Flip Service and release port 80 you could change the Web Service Port that is being used, I changed the port to 800

What I did is to go to the directory where the app is installed and change the config files

Director: C:\Program Files\ASUS\ASUS FlipLock

The config files that I changed are:

FlipController.exe.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IWifiPowerServer" />
                <binding name="BasicHttpBinding_IFlipPTPServer" />
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:800/FilpWifiPowerManager.svc"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWifiPowerServer"
                contract="WifiPowerServer.IWifiPowerServer" name="BasicHttpBinding_IWifiPowerServer" />
            <endpoint address="http://localhost:3712/FlipPTPServerManager.svc"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IFlipPTPServer"
                contract="FlipPTPServer.IFlipPTPServer" name="BasicHttpBinding_IFlipPTPServer" />
        </client>
    </system.serviceModel>
</configuration>

ReStoreWifiPower.exe.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IWifiPowerServer" />
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:800/FilpWifiPowerManager.svc"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWifiPowerServer"
                contract="WifiPowerServer.IWifiPowerServer" name="BasicHttpBinding_IWifiPowerServer" />
        </client>
    </system.serviceModel>
</configuration>

WifiPowerManager.exe.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
  <system.serviceModel>
    <services>
      <service name="WifiPowerManager.WifiPowerServer"
               behaviorConfiguration="HostedNetworkControlHostBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:800/FilpWifiPowerManager.svc"/>
          </baseAddresses>
        </host>
        <!-- this endpoint is exposed at the base address provided by host: http://localhost/FilpWifiPowerManager.svc  -->
        <!--endpoint address=""
                  binding="wsHttpBinding"
                  contract="HostedNetwrokController.IHostedNetworkOperation" /-->
        <endpoint  binding="basicHttpBinding"
                   contract="WifiPowerManager.IWifiPowerServer" >
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <!-- the mex endpoint is explosed at http://localhost/HostedNetworkController/service/mex -->
        <endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="HostedNetworkControlHostBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="False"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>



回答5:


First Do this:

  • In the Windows Task Manager window, go to the Processes tab.
  • In the menu, click View -> Select Columns.
  • In the Select Process Page Columns, select the PID (Process Identifier) checkbox.
  • Click OK.
  • CHECK the checkbox of Show Process from all users
  • In the Processes tab, find the process of the said PID in the corresponding column.

Next:

Stop the process corresponding to the PID and start XAMPP

My Guess: Either IIS or WAMP or SQL Server Reporting Services (MSSQLSERVER) or WebMatrix's "Web Deployment Agent Service" is using your port 80



来源:https://stackoverflow.com/questions/37153467/port-80-for-apache-server-is-in-use-by-pid-4-system-and-cannot-be-stopped

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!