Home  >  Article  >  Operation and Maintenance  >  How to solve the problem that the command cannot be found when executing nginx command

How to solve the problem that the command cannot be found when executing nginx command

王林
王林forward
2020-12-30 09:50:197223browse

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:

How to solve the problem that the command cannot be found when executing nginx command

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!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete