How to compile PHP with new OpenSSL library

11,926

fixed it by recompiling curl as the compiled version of curl was also using the old openssl lib

sudo ./configure -disable-shared -with-ssl=/usr/local/ssl

After compiling curl, also compiled php again --with-openssl=/usr and phpinfo tells me it is using the new openssl lib.

Share:
11,926
merlin
Author by

merlin

Updated on June 04, 2022

Comments

  • merlin
    merlin almost 2 years

    I am trying to compile PHP with OpenSSL. That works with the default OpenSSL library 0.9.6 by simply configuring with --with-openssl=/usr.

    However, I have installed a new OpenSSL library 1.0.0 which I would like to compile PHP with. This library lives in /usr/local/ssl/bin.

    That unfortunately does not work:

    configure: error: Cannot find OpenSSL's <evp.h>
    

    How can I compile PHP with the new OpenSSL library?

  • FrankyFred
    FrankyFred over 6 years
    The suggested command sudo ./configure -disable-shared -with-ssl=/usr/local/ssl if for building curl before recompile PHP
  • terary
    terary over 3 years
    php7.4> bugs.php.net/bug.php?id=79313 the --with-[option] has changed
  • stanley mbote
    stanley mbote about 2 years
    the yum install openssl-devel worked for me. I was building PHP Version 8 using binary and it was throwing an error because of openssl. But with yum install openssl-devel..the magic happened