Home >php教程 >php手册 >/usr/local/php/bin/php^M: bad interpreter: No such

/usr/local/php/bin/php^M: bad interpreter: No such

WBOY
WBOYOriginal
2016-06-06 20:11:501057browse

今天要用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后就正常 。



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn