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.
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.
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 .
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.
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.
First you need to know the path to your nginx.exe file.
Once you have that right click on your desktop and click on the new text document.
Then type or paste in the following text:
c:\ cd c:\nginx start nginx.exe cmd /k
Now save the file with whatever name you want to use but add the .bat extension to it. Example nginx.bat
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With