Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Ubuntu and I am having the following problem.

I am using a PHP function called exec to get the latest git changes from my remote repo. E.g.: exec("git pull");.

The file is placed in /var/www. When accessing from shell (user 'myapp') works fine. When done from browser, doesn't seem to work correctly.

However, this doesn't seem to work. There could be 2 problems causing this (probably both): 1) the www-data user doesn't have sufficient permissions 2) git can't connect to my bitbucket repo because I don't have the public key for the www-data user so I can add that to BitBucket to allow access from this server

Is there anyone that can help with this permissions problem? Thanks in advance!

share|improve this question
up vote 0 down vote accepted

I fixed this by installing SuPHP, so the php script runs under the user, and not under www-data.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.