webhook php file work from terminal but not from bitbucket

356
March 28, 2017, at 6:54 PM

I'm using bitbucket to host my git repository, the repo holds a test website at the moment, I have created a bitbucket webhook, so when I push to the bitbucket repo, the changes show up as live on the digitalOcean VPS, in other words.. when bitbucket receives a push, it calls the webhook php file, and that php file has a shell script that pulls from github..

the hook file

Hook path : /var/www/html/hook.php

the site folder

Site path : /var/www/html/webhooks/

the hook.php file looks like so

<?php 
echo "________PHP_AUTO_PULL________"; 
$output = shell_exec('git -C ./webhooks/ pull https://userName:password@bitbucket.org/userName/repo.git master'); 
echo "<pre>$output</pre>"; 
?>

when I do this in terminal

php hook.php

it does the job normally, and it pulls..

but the problem is, webhooks only shows this reply

________PHP_AUTO_PULL________

indicating that it does no pull, yes I have checked, no pull occured, how to make the hook execute the file normally?

permissions and owners are provided in these listings

listing for /var/www/html/

drwxrwxr-x 3 www-data www-data 4096 Mar 28 09:21 ./
drwxrwxr-x 3 www-data www-data 4096 Mar  3 16:49 ../
-rwxrwxrwx 1 www-data root      200 Mar 28 09:05 hook.php*
-rw-rw-r-- 1 www-data www-data   20 Mar  3 16:49 info.php
drwxr-xr-x 3 root     root     4096 Mar 28 09:03 webhooks/

listing for /var/www/html/webhooks/

drwxr-xr-x 3 root     root     4096 Mar 28 09:03 ./
drwxrwxr-x 3 www-data www-data 4096 Mar 28 09:21 ../
-rw-r--r-- 1 root     root      295 Mar 27 15:13 content.html
drwxr-xr-x 8 root     root     4096 Mar 28 09:03 .git/
-rw-r--r-- 1 root     root      444 Mar 27 15:13 index.html
-rw-r--r-- 1 root     root      963 Mar 27 15:13 menu_1.html
-rw-r--r-- 1 root     root       13 Mar 28 09:03 number.txt

my webserver is nginx any idea why it works from terminal, but bitbucket can't have it to work?

Rent Charter Buses Company
READ ALSO
Midedlware class is not working in Laravel 5.3

Midedlware class is not working in Laravel 5.3

I have a laravel application in this application i have following function for login user

339
url change with infinite scroll wordpress

url change with infinite scroll wordpress

Hi if someone could help I would really gratefulI am using the Woohoo wordpress news theme

372
what wrong is it?php Undefined index,filling in the form

what wrong is it?php Undefined index,filling in the form

I cannot insert the information through the page I designed

227