Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7540423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:38:25+00:00 2026-05-30T07:38:25+00:00

I was trying the Perfect Workflow, with Git, GitHub, and SSH , and i

  • 0

I was trying the Perfect Workflow, with Git, GitHub, and SSH, and i have everything set up, except running the command git pull from php.

When i run exec('git pull') i get:

Could not create directory ‘/.ssh’. Host key verification failed.
fatal: The remote end hung up unexpectedly

If i run it in the terminal (as root) it works just fine, but i need this hook to work from the Post-Receive URL (Github).

If i do exec('whoami') i get apache.

It’s a (dv) from mediatemple with CentOS.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T07:38:27+00:00Added an answer on May 30, 2026 at 7:38 am

    If you want apache (the user) to be able to pull from git, you’ll have to create an ssh key for apache, then add that to the read only keys on github.

    The flow is something like this (tweak to your needs)

    usermod -s /bin/bash apache
    su apache
    cd ~
    ssh-keygen # work through the keygen dance (added a dash)
    

    Upload (tilde here refers to apache’s homedir) ~/.ssh/id_rsa.pub to github and give apache access to whichever repos it needs to pull from.

    Then you can test on the server by again su‘ing to apache and running the git pull

    su apache
    cd ~/working-copy
    git clone my-project
    

    Once that’s working you should be able to run a git pull through PHP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to execute a command as su from php. When I put the
I am trying to get data pulled from a SQLite file, i have created
I have been trying to scrape the 'School Notices' from this URL http://www.isleworthsyon.hounslow.sch.uk/ I
I've been trying to find the perfect php framework for me that integrates with
I am trying to follow the setup on http://hide1713.wordpress.com/2009/01/30/setup-perfect-python-environment-in-emacs/ I have steps 1 -
I'm trying to combine two CSV files in PHP. I'm looking for perfect method.
My script is working perfect as it stands, but I have been trying to
I am trying to optimize a small program which calculates perfect numbers from a
I have Slider,which works perfect. But what i am trying to do is, for
we're trying our hand at migrating from cvs to git. Our goals are 1)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.