Home > Article > Operation and Maintenance > How to solve the problem that the command cannot be found when executing nginx command
Problem description:
Execute nginx stop command, prompt -bash: nginx: Command not found
(Learning video sharing: Programming Video)
As shown in the picture:
Solution
1. Open the file where the environment variable is located:
vim /etc/profile
2. At the end of the profile file, add a line
pointing to the sbin directory of your nginx installation location
PATH=$PATH:/usr/local/nginx/sbin
3. Reload the environment to solve the problem
source /etc/profile
Related recommendations: nginx tutorial
The above is the detailed content of How to solve the problem that the command cannot be found when executing nginx command. For more information, please follow other related articles on the PHP Chinese website!