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.
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.
Answered By – Larry Lane