php-git icon indicating copy to clipboard operation
php-git copied to clipboard

Error load library

Open UgoSansH opened this issue 12 years ago • 8 comments

  • Ubuntu server 12.10
  • Php : 5.4.6

CLI, I get this error:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/git2.so' - /usr/lib/php5/20100525/git2.so: undefined symbol: git_tree_create_fromindex in Unknown on line 0

on apache2

Apache2, I added an ini file in / etc/php5/apache2/conf.d/git2.ini. Apache2 chage what file (phpinfo ()), but the library is not loaded.

I can not understand why.

I followed this procedure:

git clone https://github.com/libgit2/php-git.git --recursive cd libgit2 mkdir build && cd build cmake .. cmake -DBUILD_SHARED_LIBS=OFF -build . make cd ../../ phpize ./configure make make install sudo make install

Php re

php --re git2

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/git2.so' - /usr/lib/php5/20100525/git2.so: undefined symbol: git_tree_create_fromindex in Unknown on line 0 Exception: Extension git2 does not exist

UgoSansH avatar Dec 30 '12 17:12 UgoSansH

maybe you can try again? A couple days ago I got the same error messages like you. Today I try again with php 5.3.20 and PHP 5.4.10, and load succesfully without that error message

gwijayas avatar Jan 03 '13 22:01 gwijayas

hmmm I have 2 computer each with Ubuntu 12.10 and 5.4.6. On one computer, with php ubuntu stock. Another computer with php build and compiled by myself (5.4.10 and 5.3.20). Checking with php ubuntu stock, yes, I got the same error, while on another, successfully loaded...

gwijayas avatar Jan 04 '13 00:01 gwijayas

I'm not used to compile from source, maybe I go the wrong way.

But I tried several times before posting this note.

You got the error with php 5.4?

Under what conditions you do not have an error?

UgoSansH avatar Jan 04 '13 09:01 UgoSansH

Could you share your *.so ?

UgoSansH avatar Jan 04 '13 15:01 UgoSansH

I have tested with PHP 5.4.6, 5.4.7, 5.4.8, 5.4.9, and built module with it, no error

I have tried too, transfer my so to 'ubuntu stock one', got this error message (module built with 5.4.6, compiled myself):

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/git2.so' 
- /usr/lib/php5/20100525/git2.so: undefined symbol: git_tree_create_fromindex in Unknown on line 0

gwijayas avatar Jan 05 '13 00:01 gwijayas

What I do not understand is that you get a compile and use.

I should not compile correctly, or make improper handling

UgoSansH avatar Jan 05 '13 00:01 UgoSansH

I got git2.so compiled and used because compiled it against PHP from php.net, not against ubuntu's one, eventhough I use Ubuntu OS 12.10. On PHP packages from ubuntu, there are about 60 patches, but I don't know much about C so I don't know which patch make git2 failed loaded on PHP packages.

gwijayas avatar Jan 05 '13 05:01 gwijayas

I understand. I'll try to compile php myself. I had already done that once or twice I should succeed.

This is a dev server, so I can afford;)

UgoSansH avatar Jan 05 '13 12:01 UgoSansH