Home > Article > Backend Development > Configure basic operations of Nginx+PHP under Windows (start, restart and exit)
I often mess with the system, wandering between the convenience of Windows and the magic of Linux. Once I mess with the basic configuration of the system, I have to redo it. I hereby record the basic startup, restart and exit of Nginx and PHP
Background
I often mess around with the system, wandering between the convenience of Windows and the magic of Linux. Once I mess with the basic configuration of the system, I have to redo it. I hereby record the basic startup, restart and exit of Nginx and PHP
Online Experience
There are a lot of searches for this kind of thing on the Internet, and there are also many scripts, such as the following:
@echo off taskkill /F /IM nginx.exe > nul
and the like, It doesn’t feel very “elegant”
Find another way
I don’t know how to write batch processing. I tried a few sentences but nothing was right. I had an idea to use shortcuts and command line tools to run commands. Isn't it just a call to the program with parameters? It can be like this:
1. Create a shortcut, and the connection object is nginx.exe under any path
2. Change the "target" in the properties of the shortcut ”, add -s reload after restart, add -s quit after exit, do not need to add or add what you need when starting.
3. PHP does not use this method, it still uses batch processing:
@echo off echo Starting PHP FastCGI... d:\applications\php\php-cgi.exe -b 127.0.0.1:9000 -c d:\applications\php\php-dev.ini
@echo off echo Stopping PHP... taskkill /F /IM php-cgi.exe > nul exit
Advantages and Disadvantages
Personal Feeling Shortcuts are more intuitive under Windows, you can consider using
The above is the detailed content of Configure basic operations of Nginx+PHP under Windows (start, restart and exit). For more information, please follow other related articles on the PHP Chinese website!