GithubHelp home page GithubHelp logo

Comments (11)

klaussilveira avatar klaussilveira commented on August 15, 2024

GitList will always use an absolute path to the git binary. It has nothing to do with the php binary. Or i did not understand your answer correctly?

from gitlist.

shakaran avatar shakaran commented on August 15, 2024

Yep. But on some moment on Git Client class, the path initialized on the constructor is wrong, taking a diferent path no absolute or setted on config.ini.

from gitlist.

klaussilveira avatar klaussilveira commented on August 15, 2024

It will always use the path provided on config.ini. Only when nothing is provided, GitList will use the default /usr/bin/git.

from gitlist.

shakaran avatar shakaran commented on August 15, 2024

For me it's taking /usr/local/php/bin/git instead. Because maybe php doesn't find on included_paths the git binary.

$ php -i | grep PATH
safe_mode_protected_env_vars => LD_LIBRARY_PATH => LD_LIBRARY_PATH
PATH => /usr/local/jdk/bin:/home/myuser/perl5/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/home/myuser/bin
CLASSPATH => .:/usr/local/jdk/lib/classes.zip
_SERVER["PATH"] => /usr/local/jdk/bin:/home/myuser/perl5/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/home/myuser/bin
_SERVER["CLASSPATH"] => .:/usr/local/jdk/lib/classes.zip
_SERVER["PATH_TRANSLATED"] => 
_ENV["PATH"] => /usr/local/jdk/bin:/home/myuser/perl5/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/home/myuser/bin
_ENV["CLASSPATH"] => .:/usr/local/jdk/lib/classes.zip

from gitlist.

klaussilveira avatar klaussilveira commented on August 15, 2024

There is no relationship between the GIT binary and PHP's binaries. It's just a proc_open with absolute path to the binary to be executed. The git binary should not be in the PHP include_path, there's no need to.

from gitlist.

shakaran avatar shakaran commented on August 15, 2024

Pretty weird. I jus simply print the path and command:

    public function run(Repository $repository, $command)
    {
        echo 'Path:' . $this->getPath() . '
'; echo 'Command:'. $command . '
'; $descriptors = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w")); $process = proc_open($this->getPath() . ' ' . $command, $descriptors, $pipes, $repository->getPat

It seems works fine:

Path:/usr/local/bin/git
Command:branch
Path:/usr/local/bin/git
Command:tag

Then I move the binary:

mv /usr/local/php/bin/git /usr/local/php/bin/git2

That results on:

Oops! sh: /usr/local/php/bin/git: No such file or directory

And it stills shows:

Path:/usr/local/bin/git
Command:show master:'other'

from gitlist.

klaussilveira avatar klaussilveira commented on August 15, 2024

Can you run a file /usr/local/bin/git and file /usr/local/php/bin/git?

from gitlist.

shakaran avatar shakaran commented on August 15, 2024
$ file /usr/local/bin/git
/usr/local/bin/git: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), not stripped
$ file /usr/local/php/bin/git
/usr/local/php/bin/git: symbolic link to `/usr/local/bin/git'

from gitlist.

klaussilveira avatar klaussilveira commented on August 15, 2024

You're running PHP FPM?

from gitlist.

shakaran avatar shakaran commented on August 15, 2024

The code:

<?php echo php_sapi_name();

Returns:

cgi-fcgi

from gitlist.

shakaran avatar shakaran commented on August 15, 2024

Why it is closed? It is already resolved?

from gitlist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.