1

I'm trying to compile php 5.2.x in debian gnu/linux:

./configure --with-ldap --enable-ftp --with-apxs2 --with-mcrypt --enable-bcmath --with-bz2 --enable-calendar --enable-dba=shared --enable-exif --with-gettext --enable-mbstring --with-mhash --with-readline --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-wddx --enable-zip --with-zlib --with-xsl

make

works perfect, but i need curl:

./configure --with-ldap --enable-ftp --with-apxs2 --with-mcrypt --enable-bcmath --with-bz2 --enable-calendar --enable-dba=shared --enable-exif --with-gettext --enable-mbstring --with-mhash --with-readline --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-wddx --enable-zip --with-zlib --with-xsl --with-curl

make

error:

/usr/bin/ld: ext/curl/.libs/interface.o: undefined reference to symbol 'CRYPTO_set_id_callback@@OPENSSL_1.0.0' /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status Makefile:241: recipe for target 'sapi/cli/php' failed

dpkg -l | grep openssl

ii libcurl4-openssl-dev:amd64 7.38.0-4+deb8u5
amd64 development files and documentation for libcurl (OpenSSL flavour)

ii libgnutls-openssl27:amd64 3.3.8-6+deb8u3
amd64 GNU TLS library - OpenSSL wrapper

ii openssl 1.0.1t-1+deb8u5
amd64 Secure Sockets Layer toolkit - cryptographic utility

dpkg -l | grep curl

ii curl 7.38.0-4+deb8u5
amd64 command line tool for transferring data with URL syntax

ii libcurl3:amd64 7.38.0-4+deb8u5
amd64 easy-to-use client-side URL transfer library (OpenSSL flavour)

ii libcurl3-gnutls:amd64 7.38.0-4+deb8u5
amd64 easy-to-use client-side URL transfer library (GnuTLS flavour)

ii libcurl4-openssl-dev:amd64 7.38.0-4+deb8u5
amd64 development files and documentation for libcurl (OpenSSL flavour)

UPDATE: the error is about FTP with openssl support:

./configure --with-openssl --enable-ftp

make

ext/openssl/openssl.o: In function `zm_startup_openssl': /usr/src/php-5.2.17/ext/openssl/openssl.c:681: undefined reference to `SSL_library_init' ... collect2: error: ld returned 1 exit status Makefile:228: recipe for target 'sapi/cli/php' failed make: *** [sapi/cli/php] Error 1 
5
  • Did you install package libssl1.0.0? And what Debian version are you running?CommentedNov 28, 2016 at 16:01
  • 1
    PHP 5.2 is ancient and unsupported and should not be used at all anymore.CommentedNov 28, 2016 at 16:42
  • @Daniel yes, Michael Hampton there is same issue with php 5.6 branch, i think the problem is in openssl, i will update soon
    – ZiTAL
    CommentedNov 29, 2016 at 8:11
  • Why would you want to install from source? I think it would be better to ask what is the original problem you are trying to solve, than for a fix in your solution.CommentedNov 29, 2016 at 12:28
  • @MirceaVutcovici some of my projects only works in php 5.2.x, anyway is interesting how to build it
    – ZiTAL
    CommentedNov 29, 2016 at 14:18

1 Answer 1

2

The problem was openssl, well, I installed openssl 0.9.8 from source:

Move to /usr/src compile it, and install it without man pages due to an error:

./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl no-asm -fPIC

make

make install_sw

Then i compile php with this options:

./configure --with-openssl=/usr/local/openssl --with-openssl-dir=/usr/local/openssl --with-curl --enable-ftp --with-ldap --with-apxs2 --enable-bcmath --with-bz2 --enable-calendar --enable-exif --enable-mbstring --with-mhash --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-zip --with-zlib

make

UPDATE: works for 5.6.28 too

    You must log in to answer this question.

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.