php exec函数中的非法命令错误代码127 [英] illegal command error code 127 in php exec function
本文介绍了php exec函数中的非法命令错误代码127的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用以下php代码:
I am using this php code:
exec("unrar e file.rar",$ret,$code);
,并得到一个非法命令的错误代码,即127 ...,但是当我通过ssh使用此命令时,它的工作方式是...因为在服务器上安装了unrar ...所以任何人都可以猜测为什么exec没有这样做正确的东西?
and getting an error code of illegal command ie 127 ... but when I am using this command through ssh its working ... because unrar is installed on the server ... so can anyone guess why exec is not doing the right stuff?
推荐答案
尝试使用应用程序的直接路径(/usr/bin/unrar),听起来好像php无法找到该应用程序.
Try using the direct path of the application (/usr/bin/unrar of whatever), it sounds like php can't find the application.
这篇关于php exec函数中的非法命令错误代码127的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文