Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: using Git::Wrapper with Apache

by Anneq (Vicar)
on Jun 12, 2013 at 11:33 UTC ( #1038438=note: print w/replies, xml ) Need Help??

in reply to using Git::Wrapper with Apache

When you run the script at the command line, git is using your account and permissions. When you are executing the script through a browser, it is using whatever user, permissions and environment variables, like path, are set up for the apache server.

Maybe you need to pass the path to the git binary location, as that might not be in the environment variables used by apache:

my $git = Git::Wrapper->new({ dir => '/path/to/repo' , git_binary => +'/path/to/git' });


Replies are listed 'Best First'.
Re^2: using Git::Wrapper with Apache
by tomgracey (Scribe) on Jun 12, 2013 at 13:48 UTC

    james2vegas and Anne, thanks for your suggestions. Pretty sure its not the path, they look essentially the same either way - however to be extra sure I tried setting it at the beginning of the program

    $ENV{'PATH'} = ...

    the result was the same.

    I have previously also tried specifying 'git_binary' as you suggested

    my $git = Git::Wrapper->new({ dir => '/path/to/repo' , git_binary => ' +/path/to/git' });

    which gives me the same: works on the command line, but falls over

    [error] open3: exec of git version failed at /usr/local/share/perl5/Gi +t/ line 112

    in the browser.

    Perhaps it is one of the other environment variables - but no idea which one! I will have a look. Thanks for your help anyway.

    EDIT: forgot to mention, apache is not chrooted

      This node 1034122 has instructions on how to determine exactly which environment variables and paths are used at the command line and by apache.



        For the record in the end I managed to fix this. After many false starts I went back to ground level and reinstalled git itself (it was not an easy process for various reasons) - anyway turns out we were running a broken install. With a fresh version everything appears to work.

        Lesson being - if the error message is "not available or broken" and you know its available - consider the possibility of it actually being broken!!

        Not in fact a Perl problem - apologies for the red herring

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1038438]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2022-01-22 13:04 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (62 votes). Check out past polls.