我知道OpenSSL扩展在PHP源代码中,但是当我执行apt-get install php5
时无法启用它。甚至连apt-get install php5-openssl
都没有。我该怎么做?
发布于 2013-07-22 06:30:16
我认为SSL支持不依赖于扩展,它已经内置到Ubuntu的PHP中。尝试在web服务器中创建具有以下内容的PHP文件:
<?php phpinfo() ?>
然后在浏览器(http://<server>/<file>.php
)中访问它。你应该看到:
和
我只安装了这些PHP包:libasache2-mod-php5,php5-cli,php5-公共,php5-gd,php5-mcrypt,php5-mysql。
发布于 2017-07-26 12:12:38
php -i | grep -i openssl
如果安装了OpenSSL扩展,您应该会看到如下所示:
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
在默认情况下,似乎安装了OpenSSL扩展。
如果没有这个扩展名,可以编辑php.ini文件。
来自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.
;
发布于 2017-10-31 03:57:01
我使用以下方法安装OpenSSL 1.1.0f
# 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
希望它能帮到别人!
https://askubuntu.com/questions/323005
复制相似问题