且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

-bash:php:找不到命令-Centos6.7

更新时间:2023-11-17 08:28:10

错误的路径:

查找结果:

/opt/rh/php54/root/usr/bin/php
                           ^^^--- your php binary

$ PATH仅期望 DIRECTORIES 。您在$ PATH中列出了上述路径,这意味着Shell将搜索 ... / usr / bin / php / php 。请注意加倍的 php 。第一个是您在$ PATH中添加的目录,第二个是您尝试运行的程序。 $ PATH条目应为 ... / usr / bin / ,而没有 php

$PATH expects only DIRECTORIES. You listed the above path in $PATH, which means that the shell will be searching for .../usr/bin/php/php. Note the doubled php. First one is the "directory" that you added in $PATH, while the second one is the program you're trying to run. The $PATH entry should be JUST .../usr/bin/, WITHOUT the php.