首頁 >後端開發 >php教程 >exec 返回127,该如何解决

exec 返回127,该如何解决

WBOY
WBOY原創
2016-06-13 10:10:134319瀏覽

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."

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn