I'm not sure how to recompile PHP with OpenSSL? I've been looking around the OpenSSL PHP page and the OpenSSL tutorials but I don't see any openssl.so or php-openssl.so around my server?

Is there a simple package on apt-get channel so I can install it from there?

I just need to recompile PHP with OpenSSL, but I have no idea how to do this.

EDIT: I run a dedicated server and it's Ubuntu 11.10.

  • Without knowing your distribution and release, there is no way we could tell you if there is an APT repository that would be appropriate to you.
    – Zoredache
    Jan 10, 2012 at 20:38
  • Sorry, check my edit.
    – MacMac
    Jan 10, 2012 at 21:06
  • Check that PHP isn't already compiled with OpenSSL - a lot of default installations have it already. Run phpinfo() and check for the 'OpenSSL' section. Second, if you really need to recompile PHP, copy the ./configure command from phpinfo(), and add --with-openssl (or change --without-openssl if it is present). You will need your operating system's Development Tools to compile, plus any additional pre-requisites ('dev' files/headers). It is usually preferable to avoid keeping dev tools on a production box. Finally, reinstall the additional extensions you use.
    – cyberx86
    Jan 10, 2012 at 21:54

2 Answers 2


For a while PHP has had ssl support compliled into it. No extra modules are needed. Check with phpinfo(). E.g., on Ubuntu 10.04:

$ echo '<?php phpinfo(); ?>' | php 2>&1 |grep -i ssl
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
SSL => Yes
SSL Version => OpenSSL/0.9.8k
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 0.9.8k 25 Mar 2009
OpenSSL Header Version => OpenSSL 0.9.8k 25 Mar 2009
OpenSSL support => enabled

libssl1.0.0 or libssl-dev are probably what you're looking for, though I wonder why you'd need to do this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.