


How to solve the problem that nginx cannot start because port 80 is occupied under windows
1. Install
to download the latest version used under windows, which is currently 1.11.10, as shown in the picture:
Just download and unzip it.
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)
As shown in the picture:
can also be seen in the log, open:
nginx-1.11.10\logs\error.log
As shown:
nginx is used by default Port 80, but port 80 is occupied under Windows, check:
is occupied by a process with pid 4, check:
is a system process. Take a look in the task manager:
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
3.2 Find the registration key and modify it
Found
hkey_local_machine\system\currentcontrolset\services\http
There is a reg_dword type item start registration item:
The original value is 3:
Change to 0:
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
or:
nginx.exe
As shown:
You can see in the task manager that two processes will be started in the background:
5. Close nginx
nginx.exe -s stop
or:
nginx.exe -s quit
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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

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? 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 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.

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".

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]

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.

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

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.
