/usr/local/php/bin/php^M: bad interpreter: No such
程序员文章站
2022-05-17 12:59:11
...
今天要用php cli模式运行 脚本, 我通过 /usr/local/bin/php a.php运行正常, 但是我在a.php开头加入 #! /usr/local/bin/php 运行就出错了, 爆出错误/usr/local/php/bin/php^M: bad interpreter: No such file or directory 百思不得其解, 最后发现是\r\n
今天要用php cli模式运行 脚本,
我通过 /usr/local/bin/php a.php运行正常,
但是我在a.php开头加入 #!/usr/local/bin/php
运行就出错了,
爆出错误/usr/local/php/bin/php^M: bad interpreter: No such file or directory
百思不得其解,
最后发现是\r\n引起的,
把所有\r\n换成\n后就正常 。
原文地址:/usr/local/php/bin/php^M: bad interpreter: No such, 感谢原作者分享。
推荐阅读
-
bash: /usr/bin/autocrorder: /usr/bin/python^M: bad interpreter: No such file or directory
-
bash: /usr/bin/autocrorder: /usr/bin/python^M: bad interpreter: No such file or directory
-
bash: /usr/bin/autocrorder: /usr/bin/python^M: bad interpreter: No such file or directory
-
window下编写python脚本在linux下运行出错 usr/bin/python^M: bad interpreter: No such file or directory
-
装配pdo_oci在这一步/usr/local/php/bin/phpize出现这样警告
-
zsh: /usr/local/bin/pod: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr
-
linux 下配置PHP mysql时,在启动/usr/local/mysql/bin/mysqld_safe &报错Operating system error number 13 in a file operation.解决方案
-
/usr/local/php/bin/php^M: bad interpreter: No such
-
/usr/local/php/bin/php^M: bad interpreter: No such
-
装配pdo_oci在这一步/usr/local/php/bin/phpize出现这样警告