I have a git pull web hook from Github, on two remotes, GoDaddy [production] and on Bluehost [staging]. This question isn't about those companies per se, but what could possibly be the reason for differences in the setups. I have this script, which I have setup as a post commit hook on github.com :
<?php
$output = shell_exec('git pull origin master');
echo "<pre>$output</pre>";
?>
When I commit on the Github repo, the hook fires and works fine on Bluehost. It doesn't do anything on Godaddy.
Bluehost browser response:
"already up to date". Pull command works, and the Bluehost repo is updated.
Godaddy browser response:
<pre></pre> Pull command has not worked. Repo not updated.
When I run this script via a browser:
<?php
$output = shell_exec('ls');
echo "<pre>$output</pre>";
?>
I get the proper 'ls' directory output on both servers.
When I SSH into the directory, I can manually issue the command 'git pull origin master' and it works on both servers. So does this just mean that Godaddy allows PHP to issue SOME commands, but not others? Can I fix this somehow? It can't be true that no one is automatically deploying into Godaddy!
shell_exec
executes something at all? likeecho
orls
? – Jettiejettison