1

I did compiled the openssl using the commands below:

./config --prefix=/usr/local --openssldir=/usr/local/openssl -fPIC
make
make test
make install

So, when I'm trying to compile the php I have the follow error:

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

This error occours when I running the command for to configure the PHP:
./configure --with-apxs2=/usr/local/apache2/bin/apxs  --with-libdir=/usr/lib/x86_64-linux-gnu --with-openssl --with-openssl-dir=/usr/bin --with-mysql --with-mysqli --enable-mbstring --with-mcrypt=/usr/lib/libmcrypt.so --with-pdo-mysql --enable-opcache --enable-soap --enable-sockets --with-zlib --with-bz2=/usr/local/bzip2  --with-zlib --with-curl && make clean && make && make install && service apache2 restart

Like when I compiled the openssl I needed to use the -fPIC parameter, I belive that the problem are related with the openssl.

I'm using Debian.

3
  • does 'config' accept the fpic argument directly? fpic is a gcc flag. if config isn't passing that in to gcc, then you're NOT compiling in PIC mode. Commented Nov 20, 2014 at 14:22
  • @MarcB How to know this? Commented Nov 20, 2014 at 15:39
  • libbz2.a and bzlib.o are not openssl libs. Try to substitue -fPIC when you trying compile the PHP. Commented Nov 22, 2014 at 0:30

1 Answer 1

2

If your system is 64bit, when you compile openssl, '-m64' would be added to the compile flag, just open Makefile of openssl, remove all '-m64', then

make & make install

and then go back to php source dir, make would be ok!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.