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
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.
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: