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 Xreturns 127 when X does not exist. This probably meanshgis not in the path when you execute the script. You could runwhich hgto 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 thathgcan be found.