Git WebHook will not pull (PHP)

前端 未结 4 907
[愿得一人]
[愿得一人] 2021-01-16 03:35

I have a PHP file, hook.php, that looks like this:

The file is located in /var/www/ol

4条回答
  •  一整个雨季
    2021-01-16 04:18

    I can't post a comment in reply to you, but I am assuming that you are running a *nix system. You will be getting a permission denied if your apache/php daemons don't have permission to access .git/. You can change the owner/group of the .git/ directory recursively. Or do a chmod -R o+rw .git/* to give everyone (ie, not owner, not group) access to read and write in the git directory, which should clear up the permissions error that you are getting.

    EDIT Just re-read the question, so what follows probably isn't needed, but leaving it just in case.

    Though, doing that, you need to keep in mind that anyone with access to your server will be able to go to http://myurl/.git/ etc to access those. So as a security precaution, I would add a .htaccess file like:

    order deny, allow
    deny from all
    

    in the.git directory so that apache will deny access from a web browser to everything in there.

提交回复
热议问题