当前位置: 代码迷 >> PHP >> exec 返回127,该如何解决
  详细解决方案

exec 返回127,该如何解决

热度:1392   发布时间:2012-03-15 11:50:38.0
exec 返回127
exec($command,&$output,&$result);
echo $result;die();

result返回127 
命令没找到
  这个什么概念,如何解决?

------解决方案--------------------
是执行一个外部程序吗?和其他语言语法差不多啊!

------解决方案--------------------
在做后门程序?
------解决方案--------------------
exec函数第三个参数是执行命令的状态,返回127是说明, 你执行命令的路径不对, 或没有权限等等

下面是127错误文档解释

"Remember to use the full path (IE '/usr/local/bin/foo' instead of 'foo') when using passthru, otherwise you'll get an exit code of 127 (command not found).
Remember, you'll also get this error if your file does not have executable permission."

"If you have chrooted apache and php, you will also want to put /bin/sh into the chrooted environment. Otherwise, the exec() or passthru() will not function properly, and will produce error code 127, file not found."
  相关解决方案