skip to Main Content

I want to execute Git commands (git pull, git status) from within a PHP application in a virtual host managed by Plesk (Linux).

Since the git repository was setup by a vhosts system user, PHP scripts with Git commands (e.g. exec(git pull)) executed by Apache run in permission problems.

What file permissions should the local Git repository have to be modified by the system user as well as Apache running PHP scripts?

2

Answers


  1. You should have an ssh keys and in this way you don’t have to worry about permissions since it will be done over SSH.

    Here is a list of different ways to share your code.
    Click on the desired option and it will display the content of what needs to be done.

    Login or Signup to reply.
  2. PHP scripts working under Apache user only if “apache module” is used as PHP handler on domain.

    Just switch PHP handler from apache module to FastCGI or PHP-FPM:

    Plesk PHP handler FastCGI / PHP-FPM

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search