dongwenhui8900 2015-10-14 02:52 采纳率: 0%
浏览 658

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.

  • 写回答

1条回答

  • dongpan1416 2015-10-28 09:12
    关注

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

    评论

报告相同问题?

悬赏问题

  • ¥15 一道python难题
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度