Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议不要写 #!/usr/bin/php 而是用 #!/usr/bin/env php #7

Open
zhengkai opened this issue Jul 6, 2015 · 2 comments
Open

建议不要写 #!/usr/bin/php 而是用 #!/usr/bin/env php #7

zhengkai opened this issue Jul 6, 2015 · 2 comments

Comments

@zhengkai
Copy link

zhengkai commented Jul 6, 2015

虽然前者通常情况下也好使

@feiandxs
Copy link

@zhengkai 求解后者写法有什么优势么? 我个人这么多年一直是习惯使用前面的写法,直接指到具体的 PHP 所在的绝对路径去……

@sleepm
Copy link

sleepm commented Dec 6, 2019

env php 是从path环境变量中找php,就像在命令行直接输入php并回车
如果php 不在/usr/bin/下,那就需要在环境变量中找
which php 可以看到php在哪
set | grep PATH 可以看到path变量,你在命令行输入的命令,终端都是在这些目录下去查找的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants