开发者

shell_exec('hg clone http://localhost/hg/TestProject/')... Not working

开发者 https://www.devze.com 2023-01-31 12:45 出处:网络
Can someone let me know why I\'m unable to clone local repos开发者_如何学编程 using the following code:

Can someone let me know why I'm unable to clone local repos开发者_如何学编程 using the following code:

$output = shell_exec('hg clone http://localhost/hg/TestProject/');

echo "<pre>$output</pre>";

The output is "127". What's wrong? It's working perfectly through terminal.

Thanks.


sh -c X returns 127 when X does not exist. This probably means hg is not in the path when you execute the script. You could run which hg to find out what the full path is and supply that instead (mine is /usr/bin/hg), or you could set the PATH environment variable so that hg can be found.


Seems that PHP can't find the hg executable. Try to specify the full path to hg

0

精彩评论

暂无评论...
验证码 换一张
取 消