编译PHP扩展时出错

我试图安装一个用c写的php扩展,并使用mongodb c驱动。 我一直在尝试过去的两天来编译和安装扩展,但即时获取相同的错误。

/usr/bin/ld: /usr/local/lib/libmongoc.a(bson.o): relocation R_X86_64_32S against `bson_numstrs' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libmongoc.a: could not read symbols: Bad value collect2: ld returned 1 exit status make: *** [thaps.la] Error 1 

完整的日志可以在pastbinfind: http ://pastebin.com/iqpqHYpm

我试图安装的扩展名是在bitbucket: https ://bitbucket.org/heinep/thaps

即时通讯使用PHP 5.4与Zend 2.4 Apache 2.2的mongodb C驱动程序V0.5 Ubuntu的12.04 64位

您需要安装MongoDB服务器,而不是c驱动程序。 另外安装mongodb-dev软件包,因为可能需要额外的开发头文件/文件。 如果你需要额外的帮助, mongodb.org上的文档提供了有关在Ubuntu & PHP驱动程序 上安装的详细说明。

 sh ~> sudo apt-get install mongodb-server mongodb-dev sh ~> sudo pecl install mongo 

Ubuntu的包pipe理器也可以使用php5-mongo 。

 sh ~> sudo apt-get install php5-mongo