I've set up a PHP script to perform a GitHub pull:
This is contained in my Github folder /home/mysite/public_html/github
github_pull.php
<?php
echo `git pull 2>&1`;
?>
My server does already have the SSH public key, as if I perform git pull
from Terminal:
ssh username@host.com
cd public_html/github
git pull
This works successfully (however I do have to enter the password for the rsa key first) Update: password is no longer needed (see comments)
However, when I run github_pull.php
I get the following error:
Permission denied (publickey). fatal: The remote end hung up unexpectedly
The SSH key is contained at /home/mysite/.ssh/id_rsa
When I run
<?php echo `whoami`;
It outputs mysite