一聚教程网:一个值得你收藏的教程网站

热门教程

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

时间:2022-06-30 18:55:26 编辑:袖梨 来源:一聚教程网

在使用php作为linux上shell脚本运行时出现了以下错误:

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

原因是你的文本以DOS文件形式保存,如下图所示
image_thumb_3
解决办法,使用dos2unix命令转换文档类型:

dos2unix test.php

image_thumb_4
centos安装dos2unix命令:

yum -y install dos2unix

热门栏目