64 bit Linux/Ubuntu and openssl issue (could not r

2019-05-08 08:46发布

Normally I search a lot and read a lot to fix my issues, but for this particular problem, it has been pretty unproductive.

I am running a 64bit Ubuntu Linux server on which I installed LAMP stack, and had problem with libcurl not having SSL support, while the OS binary does have SSL support. The PHP just cannot read it. When I searched for solutions and tried doing the following to enable ssl support while installing PHP, I got the problem..

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

So, it quit suddenly. I tried doing --enable-shared --without-pic arguments to no avail.

3条回答
迷人小祖宗
2楼-- · 2019-05-08 09:16

Okay, sorry for not search properly in SO itself. One of the related topics had an answer to this problem. relocation R_X86_64_32 against a local symbol' error

All I had to do was do a fresh install of openssl this time with enable-shared option during configure

./config enable-shared

Then I had to do a fresh install of cURL

./configure --with-ssl=/usr/local/ssl --with-zlib

Then I had to do a fresh install of PHP

./configure .... --with-openssl --with-curl ....

..and that did it. The PHP cURL extension has SSL support.

查看更多
贪生不怕死
3楼-- · 2019-05-08 09:16

also execute the command,

make clean
查看更多
仙女界的扛把子
4楼-- · 2019-05-08 09:41

As a more generic answer, one typically runs into this problem when the library you are trying to compile is looking for a shared library of a dependency, but the dependency itself was built with only static library support.

The way to fix the problem would be to recompile the dependency with shared library support, usually done by specifying the --enable-shared flag to the configure script.

查看更多
登录 后发表回答