I m using the nginx/PHP/MongoDB stack and trying to set up my development environment on Windows by creating two batch files.
开始。
cd C:www
ginx
start nginx
cd C:wwwphp
start php-cgi.exe -b 127.0.0.1:9000
cd C:wwwmongodb
start mongod
停下来。
cd C:www
ginx
nginx -s quit
cd C:wwwphp
taskkill /F /IM php-cgi.exe
cd C:wwwmongodb
mongo --eval "use admin; db.shutdownServer(); quit" # this doesn t work
mongo --eval stop_mongod.js # this doesn t work either
Using taskkill to stop mongod isn t an option, since that may lead to data corruption. Any suggestions?