Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't run the Nginx executable file

Tags:

windows

nginx

I've installed Nginx web server on my machine under Windows 7 with php.

When I start the "nginx.exe", the command prompt opens for a second and then closes automatically, so I can't control it through the command prompt. Couldn't find a solution anywhere.

What I want is to open the "nginx.exe" and use various commands there.

Otherwise the server is working.

like image 466
Камен Давидков Avatar asked Aug 20 '15 11:08

Камен Давидков


People also ask

How do I run nginx exe?

Windows Startup shortcutCreate one shortcut of nginx.exe and put it in the startup folder of Windows. Follow this answer to find your startup location. You can type `shell: startup` in your run window to navigate to the startup directory. Nginx will run automatically whenever you log in to the system.

Where is the nginx executable?

It is set to the /usr/local/nginx directory by default. sets the name of an NGINX executable file. This name is used only during installation. By default the file is named prefix/sbin/nginx .

How do I know if nginx is installed on Windows?

Verify Nginx Windows Installation You should be able to go to http://localhost/ and you should see the “Welcome to Nginx” default page. If you see that page, then we can be sure that Nginx has been installed properly. We will now shut it down and install it as a service, to stop it, you can use this command.

How do I start nginx on Windows?

Nginx comes pre-compiled direct from their website, which makes installation as simple as downloading and extracting a file. Download the latest mainline release from https://nginx.org/en/download.html. Extract the file to the location where you want to install Nginx, such as C:\nginx.


1 Answers

  1. First you need to know the path to your nginx.exe file.

  2. Once you have that right click on your desktop and click on the new text document.

  3. Then type or paste in the following text:

c:\
cd c:\nginx
start nginx.exe
cmd /k
  1. Now save the file with whatever name you want to use but add the .bat extension to it. Example nginx.bat

  2. Now you can click on the file and it should open the command prompt, change the directory, start the server, and then leave the prompt open in the correct directory so you can run your commands.

like image 128
Larry Lane Avatar answered Sep 30 '22 06:09

Larry Lane