Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Oracle Linux 上运行,当我尝试使用该apachectl start命令启动我的 Apache 服务器时,我收到了一些错误。但是,当我尝试使用该sudo apachectl start命令时,它运行良好。我检查了两个版本:apachectl -V和sudo apachectl -V,我注意到这两个版本使用不同的版本(2.2.15 有sudo,2.4.4 没有)。
apachectl start
sudo apachectl start
apachectl -V
sudo apachectl -V
sudo
为什么是这样?sudo 在查找命令时是否使用不同的路径?
任何帮助表示赞赏。
在您的用户帐户中尝试以下命令:
env | grep ^PATH=
现在,将其与以 root 身份运行的同一命令的输出进行比较:
sudo env | grep ^PATH=
路径是否相同?