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

王林
Release: 2020-12-30 09:50:19
forward
7205 people have browsed it

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
Copy after login

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
Copy after login

3. Reload the environment to solve the problem

source /etc/profile
Copy after login

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!