libgit2 / php-git

PHP bindings for libgit2
http://libgit2.github.com
MIT License
563 stars 118 forks source link

Error load library #43

Open UgoSansH opened 11 years ago

UgoSansH commented 11 years ago

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

gwijayas commented 11 years ago

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 commented 11 years ago

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...

UgoSansH commented 11 years ago

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 commented 11 years ago

Could you share your *.so ?

gwijayas commented 11 years ago

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
UgoSansH commented 11 years ago

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

I should not compile correctly, or make improper handling

gwijayas commented 11 years ago

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.

UgoSansH commented 11 years ago

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;)