Git错误:.git / FETCH_HEAD:权限被拒绝
  1. I did clone as apache user
  2. Created php file with exec("git pull origin master 2>&1", $out);

Terminal as root or as apache works fine: php auto_deploy.php

But http http://.../auto_deploy.php return error
error: cannot open .git/FETCH_HEAD: Permission denied

Folder owner and group are same "apache".

Chmod 777 does not help.

The main difference is, that when php file launched from HTTP it does not work, it feels like it knows that it is http and blocking it, because in terminal Apache user works perfect with git even launching php file.

donglian5309
donglian5309 您可以尝试使用http(s)协议而不是ssh(或git)。
接近 5 年之前 回复

1个回答



对于用例,您描述Apache用户将需要其SSH密钥批准,以便它可以访问远程存储库。</ p>

</ div>

展开原文

原文

For the use case you describe the Apache user will needs its SSH key approving so that it can access the remote repository.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐