我正在尝试调用 shell 包装器进行 phing
phing
Run Code Online (Sandbox Code Playgroud)
...但它不能识别环境,我得到一个
-bash: phing: command not found
Run Code Online (Sandbox Code Playgroud)
...即使文件以:
#!/usr/bin/env php
Run Code Online (Sandbox Code Playgroud)
调用文件
php phing
Run Code Online (Sandbox Code Playgroud)
工作得很好。
该文件是可执行的,我从它自己的目录中调用它。
这怎么可能?
chmod +x phing$PATH. 在没有绝对或相对路径的情况下调用二进制文件会告诉您的 shell 在您的文件中查找它$PATH并运行它找到的第一个。运行which phing以检查您的 shell 是否可以找到它。./phing(在同一目录中phing)/path/to/phing