{"id":8463757,"date":"2016-11-21T13:50:57","date_gmt":"2016-11-21T13:50:57","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/wrong-path-for-git\/"},"modified":"2016-11-21T13:50:57","modified_gmt":"2016-11-21T13:50:57","slug":"wrong-path-for-git","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/wrong-path-for-git\/","title":{"rendered":"Wrong Path for Git"},"content":{"rendered":"<p>Hi there, I&#8217;m really enjoying your plugin. I got it setup successfully on one server, but I&#8217;m having trouble with it on another. This appears to be a path issue. I am seeing &#8220;There is no git installed on this server&#8221; in WordPress and command not found for Git in the server logs. <\/p>\n<p>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: <\/p>\n<p>============================<br \/>\n&lt;?php<\/p>\n<p>$descriptorspec = array(<br \/>\n    0 =&gt; array(&#8220;pipe&#8221;, &#8220;r&#8221;),<br \/>\n    1 =&gt; array(&#8220;pipe&#8221;, &#8220;w&#8221;),<br \/>\n    2 =&gt; array(&#8220;file&#8221;, &#8220;\/home\/www\/domain.com\/tmp\/error-output.txt&#8221;, &#8220;a&#8221;) );<\/p>\n<p>$env = array(<br \/>\n    &#8216;PATH&#8217; =&gt; &#8216;\/usr\/local\/bin&#8217; \/\/Path to bin dir to pick up git executable<br \/>\n);<\/p>\n<p>$process = proc_open(&#8220;git &#8211;version&#8221;, $descriptorspec, $pipes, __DIR__, $env);<\/p>\n<p>echo stream_get_contents($pipes[1]);<br \/>\nfclose($pipes[1]);<\/p>\n<p>?&gt;<br \/>\n=============================<\/p>\n<p>The code above illustrates how it could be done on this server. It seems like I&#8217;d need to modify the plugin code to get this working, but perhaps there&#8217;s a better way. Any ideas? <\/p>\n<p>Thanks again for such a great plugin. It&#8217;s definitely a time saver for new site configs and version control. <\/p>\n","protected":false},"template":"","class_list":["post-8463757","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/8463757","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/8463757\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=8463757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}