如何在RHEL for PHP 7.2中启用openssl?

时间:2019-05-01 13:45:47

标签: php redhat php-7

当我尝试安装pear库时,出现以下错误。

PHP Warning:  PHP Startup: Unable to load dynamic library 'openssl' (tried: ext/openssl (ext/openssl: cannot open shared object file: No such file or directory), ext/openssl.so (ext/openssl.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: ext/openssl (ext/openssl: cannot open shared object file: No such file or directory), ext/openssl.so (ext/openssl.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
No releases available for package "pear.php.net/XML_Parser"
install failed

如何启用openssl?

在php.ini中。我没有评论extension = openssl。 但是openssl.so文件不存在。 openssl是否需要单独下载和安装?

2 个答案:

答案 0 :(得分:0)

此模块可能不存在:

$ ls -la /usr/lib64/php-zts/modules/ | grep ssl
$ ls -la /usr/lib64/php/modules/ | grep ssl

答案 1 :(得分:0)

您不需要在php.ini中取消注释扩展,扩展是动态加载的。

要查看有效的扩展程序,您可以执行以下操作:

php -me

如果没有openssl,则需要安装它。结帐rpmfind