I was trying to pull from a GIT repository using exec() in a webserver PHP script, too.
The remote repository was checked out read-only under a different user.
My main problem was that when running the webserver PHP script the EXEC result variables from the PULL were completely empty - I just could tell that the PULL did not happen, no further error messages, nothing. A simple 'git help' did work, though.
What fixed the problem was the following:
First I make the webserveruser owner of the repository directory:
chown -R <webserveruser>:<webusergroup> <repodir>
Usually can't login to the webserver user, so I had assign a shell first:
usermod -s /bin/bash <webserveruser>
Login as webserver user:
Then change to the repodirectory and do a manual pull :
Exit the webserver user and go back to root and disable the shell on the webserver user again:
usermod -s /bin/false <webserveruser>
As strange as it sounds: After that the read-only PULL using the webserver script worked just fine.