• jasonmj

    (@jasonmj)


    Hi there, I’m really enjoying your plugin. I got it setup successfully on one server, but I’m having trouble with it on another. This appears to be a path issue. I am seeing “There is no git installed on this server” in WordPress and command not found for Git in the server logs.

    However, I am certain that Git is installed and the web user has access to use it. I did some testing to check on the path and it appears that proc_open needs a custom env path in this case:

    ============================
    <?php

    $descriptorspec = array(
    0 => array(“pipe”, “r”),
    1 => array(“pipe”, “w”),
    2 => array(“file”, “/home/www/domain.com/tmp/error-output.txt”, “a”) );

    $env = array(
    ‘PATH’ => ‘/usr/local/bin’ //Path to bin dir to pick up git executable
    );

    $process = proc_open(“git –version”, $descriptorspec, $pipes, __DIR__, $env);

    echo stream_get_contents($pipes[1]);
    fclose($pipes[1]);

    ?>
    =============================

    The code above illustrates how it could be done on this server. It seems like I’d need to modify the plugin code to get this working, but perhaps there’s a better way. Any ideas?

    Thanks again for such a great plugin. It’s definitely a time saver for new site configs and version control.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Wrong Path for Git’ is closed to new replies.