PHP OpenSSL extension has a package?

225,426

Solution 1

I think SSL support doesn't depend on an extension, it's already built into Ubuntu's PHP. Try creating a PHP file in your web server with this content:

<?php phpinfo() ?>

then access it in a browser (http://<server>/<file>.php). You should see:

enter image description here

and

enter image description here

I have only these PHP packages installed: libapache2-mod-php5, php5-cli, php5-common, php5-gd, php5-mcrypt, php5-mysql.

Solution 2

Try:

php -i | grep -i openssl

If you have the OpenSSL extension installed, you should see something like this:

openssl
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 1.0.1f 6 Jan 2014
OpenSSL Header Version => OpenSSL 1.0.1f 6 Jan 2014
openssl.cafile => no value => no value
openssl.capath => no value => no value
OpenSSL support => enabled

It seems that the OpenSSL extension is installed by default.

Update:

If you don't have this extension, you can edit php.ini file.

From php.ini:

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;

; If you wish to have an extension loaded automatically, use the following
; syntax:
;
;   extension=modulename.extension
;
; For example, on Windows:
;
;   extension=msql.dll
;
; ... or under UNIX:
;
;   extension=msql.so
;
; ... or with a path:
;
;   extension=/path/to/extension/msql.so
;
; If you only provide the name of the extension, PHP will look for it in its
; default extension directory.
;

Solution 3

I installed OpenSSL 1.1.0f using

# apt-get install openssl

# php -i | grep -i openssl
openssl
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 1.1.0f  25 May 2017
OpenSSL Header Version => OpenSSL 1.1.0f  25 May 2017
Openssl default config => /usr/lib/ssl/openssl.cnf
openssl.cafile => no value => no value
openssl.capath => no value => no value
Native OpenSSL support => enabled

Hope it help someone!

Share:
225,426

Related videos on Youtube

Tasso Evangelista
Author by

Tasso Evangelista

Front-End Engineer

Updated on September 18, 2022

Comments

  • Tasso Evangelista
    Tasso Evangelista over 1 year

    I know that OpenSSL extension is in PHP source, but I can't enable it when I perform apt-get install php5. There is not even a apt-get install php5-openssl. How I must proceed?

    • dbf
      dbf over 7 years
      I know this post is old, just some general info. By default, PHP's packages are distributed with --with-openssl=[defaultpath]. It means you only have to install openssl (or any other variant) e.g. sudo apt-get install openssl (also check which version of openssl to install due to heartbleed, e.g. sudo apt-cache policy openssl. To check wether PHP is enabled with openssl just type php -m | grep openssl and php -i | grep OpenSSL.
  • Tasso Evangelista
    Tasso Evangelista over 10 years
    A personal build was forgotten in my system... Thanks!
  • Overclover
    Overclover over 7 years
    Or call the function in a terminal php -i | grep -i openssl
  • Braian Mellor
    Braian Mellor over 6 years
    if not what's the answer?
  • simhumileco
    simhumileco over 6 years
    @BraianMellor In php.ini try to change ;extension=php_openssl.dll to extension=php_openssl.dll or maybe look for answer at simplemachines.org/community/index.php?topic=310264.0 Good luck!
  • Braian Mellor
    Braian Mellor over 6 years
    .dll on Linux? Are you sure?
  • simhumileco
    simhumileco over 6 years
    @BraianMellor you have right it is not solution for Linux... I updated the content of answer...
  • Braian Mellor
    Braian Mellor over 6 years
    My solution was installing the openssl by apt-get. Best!
  • simhumileco
    simhumileco over 6 years
    @BraianMellor write the answer :)
  • JulioHM
    JulioHM about 5 years
    Quick oneliner to list all modules currently enabled in your PHP binary: php -i | grep enabled