Reputation: 175
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.
Upvotes: 14
Views: 21885
Reputation: 355
I made a different version of the script of Larry Lane. With this version you can invoke nginx from any path.
The script needs to be in any route accessible via Windows path and should be named nginx.bat.
@echo off
SET var=%cd%
cd C:/nginx
nginx %*
cd %var%
Execution example:
Upvotes: 1
Reputation: 2191
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.
Upvotes: 7