Internal Server Error 500 on Ubuntu 11.04
iannil opened this issue · 8 comments
hi , after installing the php-git with no error , I run the file in tests folder on Ubuntu 11.04 , the browser display internal server error 500.
The versions : PHP 5.3.5 , Mysql 5.1.63 , Apache 2.0
function of extension_loaded("git2") return true.
$repo = Git2\Repository::init("/var/www/test/",true) return error 500.
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
hmm, can you try this with php-cli?
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();
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] {
}
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.
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
.