Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 or 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.

share|improve this question
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 '12 at 20:38
Sorry, check my edit. – MacMac Jan 10 '12 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 '12 at 21:54
up vote 11 down vote accepted

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
share|improve this answer

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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