I am trying to set up an automatic
git pull on a shared server that gets triggered when I push to a github repo.
I set up the github repo and I can push/pull from my local machine and as well when I'm logged in via ssh on the server.
When I type
git pull in the console, it works like a charm and the files get updated. But when I use php shell_exec I get an error message:
Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
This is the content of the php file I call:
$output = shell_exec('git pull 2>&1'); echo "<h1>Github pull</h1>"; echo "<pre>".$output."</pre>";