【发布时间】:2018-08-21 20:20:34
【问题描述】:
我正在尝试在共享服务器上设置一个自动git pull,当我推送到 github 存储库时会触发它。
我设置了 github 存储库,我可以从本地计算机推送/拉取,当我通过服务器上的 ssh 登录时也是如此。
当我在控制台中输入git pull 时,它就像一个魅力,并且文件得到更新。但是当我使用 php shell_exec 时,我收到一条错误消息:
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
这是我调用的php文件的内容:
$output = shell_exec('git pull 2>&1');
echo "<h1>Github pull</h1>";
echo "<pre>".$output."</pre>";
【问题讨论】: