Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to setup/debug github WebHook?
    text
    copied!<p>I have this local repo, I make changes and run:</p> <pre><code>git add . git commit -m "message" git push -u origin master </code></pre> <p>My github has two WebHooks set-up, one going to a <a href="http://requestb.in" rel="nofollow">http://requestb.in</a> URL and another one going to a PHP executable script (755), in the same folder (accessible from outside). </p> <p>The PHP script:</p> <pre><code>&lt;?php echo `git pull origin master`; // echo "works"; // echo `whoami` ?&gt; </code></pre> <p>The commented test lines are working so this is my proof that the script path is OK and also the syntax.</p> <p>However, after I push changes from local to github repo, I check files on the server but nothing happens, is obvious echo <code>git pull origin master</code> from my PHP script does nothing. </p> <p>If I run this in a shell logged as a root (git pull origin master), the files are getting updated with the latest version from the repo.</p> <p>Also, the second hook I have set-up, the one from requestb.in works as I can see the requests from github.</p> <p>My folder on the server has the right permission, is accessible form the outside, I am desperate and I don't know how to get this working.</p> <p><strong>What is wrong, how can I make this working? How do I set-up the WebHook in the admin panel in github</strong>, or is it the PHP script, is there a permissions issue, what's wrong?! :O</p> <p>Thank you.</p> <p>Update after my 3 comments: After dealing with it for couple more hours, I can clearly see that the WebHook doesn't really fire up the php file. If I run in shell logged as a root "php test.php" I get:</p> <pre><code>root@echo [/home/moove/public_html/dev/wert]# php hooh.php remote: Counting objects: 5, done. remote: Compressing objects: 100% (1/1), done. remote: Total 3 (delta 1), reused 3 (delta 1) Unpacking objects: 100% (3/3), done. From github.com:chrisdemetriad/wert * branch master -&gt; FETCH_HEAD Updating 0c67b85..89e4fdf Fast-forward XXX.php | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) root@echo [/home/moove/public_html/dev/wert]# </code></pre> <p>Which is what I need and the files on the server get updated. But if I don't do it manually, the files do not get updated and this must be because of the php script. My latest version that works:</p> <pre><code>&lt;?php echo `git pull origin master`; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload