Debian - /usr/bin/env: #39;php#39;: No such file or directory(Debian -/usr/bin/env: php: 没有那个文件或目录)
问题描述
所以直接解决问题,当我运行 ./yii 时,我似乎从 Debian:stretch 那里得到了我从 Docker 运行的错误.
So go straight to the problem, when I run ./yii seems I got that error from Debian:stretch that I ran from Docker.
但是,当我运行 /usr/bin/env php -v 时,我得到了正确的输出并且没有问题.
However when I run /usr/bin/env php -v I got the correct output and there's no problem on it.
似乎在将新行翻译为字符串时出现问题,我不知道如何解决.
Seems there's a problem on new line being translated as string and I have no idea how to fix it.
对不起,如果我的英语有点乱,提前致谢.
Sorry if my English a bit messy and thanks in advance.
请注意:
- 我一直在尝试在 debian 中使用
nano编辑该文件,但它没用.我遇到了同样的错误. - 我检查了
/usr/bin/php中的 php 文件,它同时存在php和php7.1 - 我也可以毫无问题地运行
php -v
- I've been trying to edit that file using
nanowithin debian but it's useless. I'm getting the same error. - I've check php file within
/usr/bin/phpand it's exist bothphpandphp7.1 - I can run
php -vwithout problem as well
推荐答案
您应该使用 UNIX 换行约定转换文件.
You should convert the file with UNIX new line convention.
您有一个 DOS 文件,它在
之前有一个额外的
字符,它被解释为命令中的一个字符.所以系统会检查程序php
而不是php,所以它失败了.
You have a DOS file, which has the extra
character before
, which is interpreted as a character in the command. So system will check the program php
and not php, and so it fails.
tr -d '15' < original_file > converted_file
应该做的工作(StackOverflow还有很多其他的方法和技巧)
should do the work (StackOverflow has many other methods and tricks)
这篇关于Debian -/usr/bin/env: 'php ': 没有那个文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Debian -/usr/bin/env: 'php ': 没有那个文件或目录
基础教程推荐
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 如何替换eregi() 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
