通常情况下,我经常搜索并阅读很多内容以解决我的问题,但对于这个特殊问题,它一直非常无效。
我正在运行一个64位Ubuntu Linux服务器,我在其上安装了LAMP堆栈,并且libcurl没有SSL支持存在问题,而OS二进制文件确实有SSL支持。 PHP无法读取它。当我搜索解决方案并尝试执行以下操作以在安装PHP时启用ssl支持时,我遇到了问题..
./configure .... --with-openssl
...
....
/usr/bin/ld: ext/standard/.libs/info.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
ext/standard/.libs/info.o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [libphp5.la] Error 1
所以,它突然退出了。我尝试做--enable-shared --without-pic参数无济于事。
答案 0 :(得分:4)
好的,抱歉没有在SO中正确搜索。其中一个相关主题可以解决这个问题。 relocation R_X86_64_32 against a local symbol' error
我所要做的就是在配置期间使用enable-shared选项进行全新的openssl安装
./config enable-shared
然后我不得不重新安装cURL
./configure --with-ssl=/usr/local/ssl --with-zlib
然后我不得不重新安装PHP
./configure .... --with-openssl --with-curl ....
..那就做到了。 PHP cURL扩展具有SSL支持。
答案 1 :(得分:3)
作为一个更通用的答案,当您尝试编译的库正在寻找依赖项的共享库时,通常会遇到此问题,但依赖项本身仅使用静态库支持构建。
解决问题的方法是使用共享库支持重新编译依赖项,通常通过为configure脚本指定--enable-shared标志来完成。
答案 2 :(得分:0)
也执行命令
localMachine\Personal