Home Operation and Maintenance Nginx How to solve the problem that nginx cannot start because port 80 is occupied under windows

How to solve the problem that nginx cannot start because port 80 is occupied under windows

May 16, 2023 pm 09:56 PM
windows nginx

1. Install

to download the latest version used under windows, which is currently 1.11.10, as shown in the picture:

How to solve the problem that nginx cannot start because port 80 is occupied under windows

Just download and unzip it.

How to solve the problem that nginx cannot start because port 80 is occupied under windows

2. Run

Run nginx, error message:

[emerg] 10348#10940: bind() to 0.0.0.0:80 failed (10013: an attempt was made to access a socket in a way forbidden by its access permissions)
Copy after login

As shown in the picture:

How to solve the problem that nginx cannot start because port 80 is occupied under windows

can also be seen in the log, open:

nginx-1.11.10\logs\error.log
Copy after login

As shown:

How to solve the problem that nginx cannot start because port 80 is occupied under windows

nginx is used by default Port 80, but port 80 is occupied under Windows, check:

How to solve the problem that nginx cannot start because port 80 is occupied under windows

is occupied by a process with pid 4, check:

How to solve the problem that nginx cannot start because port 80 is occupied under windows

is a system process. Take a look in the task manager:

How to solve the problem that nginx cannot start because port 80 is occupied under windows

Sure enough.

3. Problem Solving

The solution is to stop the system process from occupying port 80, and you need to modify the registry.

3.1 Open the registry

Enter regedit

How to solve the problem that nginx cannot start because port 80 is occupied under windows

3.2 Find the registration key and modify it

Found

hkey_local_machine\system\currentcontrolset\services\http
Copy after login

There is a reg_dword type item start registration item:

How to solve the problem that nginx cannot start because port 80 is occupied under windows

The original value is 3:

How to solve the problem that nginx cannot start because port 80 is occupied under windows

Change to 0:

How to solve the problem that nginx cannot start because port 80 is occupied under windows

3.3 Restart the operating system

Restart windows system, the original system process will not occupy port 80.

4. Re-run nginx

Run in the nginx installation directory:

start nginx.exe
Copy after login

or:

nginx.exe
Copy after login

As shown:

How to solve the problem that nginx cannot start because port 80 is occupied under windows

You can see in the task manager that two processes will be started in the background:

How to solve the problem that nginx cannot start because port 80 is occupied under windows

5. Close nginx

nginx.exe -s stop
Copy after login

or:

nginx.exe -s quit
Copy after login

stop can stop nginx quickly, but it may not save relevant information; quit is a complete and orderly stop of nginx. This process Relevant information will be saved.

The above is the detailed content of How to solve the problem that nginx cannot start because port 80 is occupied under windows. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to check the name of the docker container How to check the name of the docker container Apr 15, 2025 pm 12:21 PM

You can query the Docker container name by following the steps: List all containers (docker ps). Filter the container list (using the grep command). Gets the container name (located in the "NAMES" column).

How to configure nginx in Windows How to configure nginx in Windows Apr 14, 2025 pm 12:57 PM

How to configure Nginx in Windows? Install Nginx and create a virtual host configuration. Modify the main configuration file and include the virtual host configuration. Start or reload Nginx. Test the configuration and view the website. Selectively enable SSL and configure SSL certificates. Selectively set the firewall to allow port 80 and 443 traffic.

How to check whether nginx is started How to check whether nginx is started Apr 14, 2025 pm 01:03 PM

How to confirm whether Nginx is started: 1. Use the command line: systemctl status nginx (Linux/Unix), netstat -ano | findstr 80 (Windows); 2. Check whether port 80 is open; 3. Check the Nginx startup message in the system log; 4. Use third-party tools, such as Nagios, Zabbix, and Icinga.

How to start containers by docker How to start containers by docker Apr 15, 2025 pm 12:27 PM

Docker container startup steps: Pull the container image: Run "docker pull [mirror name]". Create a container: Use "docker create [options] [mirror name] [commands and parameters]". Start the container: Execute "docker start [Container name or ID]". Check container status: Verify that the container is running with "docker ps".

How to create containers for docker How to create containers for docker Apr 15, 2025 pm 12:18 PM

Create a container in Docker: 1. Pull the image: docker pull [mirror name] 2. Create a container: docker run [Options] [mirror name] [Command] 3. Start the container: docker start [Container name]

Can vs code run in Windows 8 Can vs code run in Windows 8 Apr 15, 2025 pm 07:24 PM

VS Code can run on Windows 8, but the experience may not be great. First make sure the system has been updated to the latest patch, then download the VS Code installation package that matches the system architecture and install it as prompted. After installation, be aware that some extensions may be incompatible with Windows 8 and need to look for alternative extensions or use newer Windows systems in a virtual machine. Install the necessary extensions to check whether they work properly. Although VS Code is feasible on Windows 8, it is recommended to upgrade to a newer Windows system for a better development experience and security.

How to start nginx How to start nginx Apr 14, 2025 pm 01:06 PM

Question: How to start Nginx? Answer: Install Nginx Startup Nginx Verification Nginx Is Nginx Started Explore other startup options Automatically start Nginx

vscode cannot install extension vscode cannot install extension Apr 15, 2025 pm 07:18 PM

The reasons for the installation of VS Code extensions may be: network instability, insufficient permissions, system compatibility issues, VS Code version is too old, antivirus software or firewall interference. By checking network connections, permissions, log files, updating VS Code, disabling security software, and restarting VS Code or computers, you can gradually troubleshoot and resolve issues.

See all articles