Code Monkey home page Code Monkey logo

Comments (8)

iannil avatar iannil commented on July 1, 2024

function of extension_loaded("git2") return true.
$repo = Git2\Repository::init("/var/www/test/",true) return error 500.

from php-git.

iannil avatar iannil commented on July 1, 2024

Sorry,It's a new computer and I forgot to turn on display errors.
The infomation of errors below:
Fatal error: Uncaught exception 'Exception' with message '-1235075708 (error code -1)' in /var/www/test-git.php:2 Stack trace: #0 /var/www/test-git.php(2): Git2\Repository::init('/var/www/testst...', true) #1 {main} thrown in /var/www/test-git.php on line 2

from php-git.

chobie avatar chobie commented on July 1, 2024

hmm, can you try this with php-cli?

from php-git.

iannil avatar iannil commented on July 1, 2024

php-cli return this:PHP Fatal error: Class 'Git2\Repository' not found in /var/www/test-git.php on line 3
but the extension didn't return any error when I install it and it could be found in phpinfo();

from php-git.

chobie avatar chobie commented on July 1, 2024

Fatal error: Uncaught exception 'Exception' with message '-1235075708 (error code -1)' in /var/www/test-git.php:2 Stack trace: #0 /var/www/test-git.php(2): Git2\Repository::init('/var/www/testst...', true) #1 {main} thrown in /var/www/test-git.php on line 2

I guess you don't have a permission to init a repo on that directory. I'll fix this error message later.

php-cli return this:PHP Fatal error: Class 'Git2\Repository' not found in /var/www/test-git.php on line 3 but the extension didn't return any error when I install it and it could be found in phpinfo();

is this still happen? probably namespace issue i think. can you run php --re git2?

$ php --re git2 |head
Extension [ <persistent> extension #33 git2 version 0.2.1 ] {

  - Classes [17] {
    Class [ <internal:git2> class Git2\Repository ] {

      - Constants [0] {
      }

      - Static properties [0] {
      }

from php-git.

iannil avatar iannil commented on July 1, 2024

php --re git2 return that extension git2 does not exist.
some other extension like phpredis works well , but when I run php --re redis , it returns the extension does not exist too.

from php-git.

chobie avatar chobie commented on July 1, 2024

php --re git2 return that extension git2 does not exist.

this means your php-cli doesn't load git2 extension. you should check ini with php --ini.

from php-git.

iannil avatar iannil commented on July 1, 2024

hi , @chobie thanks for your reply and extension, it works now.

from php-git.

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.