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.