Nginx port occupancy, start error: Bind () to 0.0.0.0:80 failed (10013:an attempt is made to access a socket in a-a-type F

Source: Internet
Author: User
Tags bind php development environment socket port number

I need to configure the project to use Nginx, and nginx is not up, I looked at Nginx in the Logs folder Error.log error log, found that the error message is:

2017/04/20 16:00:52 [Emerg] 4276#4280:bind () to 0.0.0.0:80 failed (10013:an attempt is made to access a socket in a The forbidden by its access permissions)

It is known from the Scarlet Letter section that the 80 port is occupied, causing Nginx to fail to boot.

Solutions

1 Press the keyboard win+r to open the Run interface, enter cmd, OK, open the Administrator interface


2 input Netstat-aon | findstr:80

Look for port occupancy, find out which port number 0.0.0.0:80, my Apache2.2 (used in the previous configuration of the PHP development environment) occupied, after viewing, the PID value is 4300

3 input Tasklist|findstr "4300"

Find the service name for Port 4300, Httpd.exe, this is apache2.2. If you do not know which file, Baidu can find the corresponding service name.

4 then stop the service in the computer service, remove the occupation

5 when the corresponding service is stopped, Nginx will start normally.


6 other port-occupied issues can also be resolved in this way.

Make a note and hope to help others. The first time to write related articles, what is not thoughtful place to understand.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.