Unable to load dynamic library 'openssl'

Keywords: LAMP/MAMP/WAMP - AWS - Technical issue - Secure Connections (SSL/HTTPS)
bnsupport ID: a0f728f0-0d6a-3f62-fe4c-ee31be3ec98a
Description:
Hi there!

I have a EC2 AWS instance with the AMI bitnami-lampstack-7.4.13-4-r08-linux-debian-10-x86_64-hvm-ebs-nami-cb6afd05-a3b2-4916-a3e6-bccd414f5f21-ami-00f69eadcce319e16.4

After enable the openssl extension in the PHP config file /opt/bitnami/php/etc/php.ini the console print this message:

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

Could you offer me any clue about Why this happend?

Hi @dualklip,

The OpenSSL module for PHP is already enabled by default.

Regards,
Michiel

Yes, could be enabled by default. But as you can see in the warning the library is not there. why? and how can I fix the problem?

Hi @dualklip,

The openSSL module is directly compiled in the PHP core, so it’s not shipped as an extension.

Regards,
Michiel

Thank you for your answer @michiel. Then, why the system can not find the module showing the message?

Hi @dualklip

Yes, could be enabled by default. But as you can see in the warning the library is not there.

OpenSSL is, in fact, enabled by default at compilation time in this asset. The shared library is not there because you can either load extensions dynamically (the PHP binary will go to the specified directory and try to look for a matching *.so file, loading it so as to implement new features) or statically (when Bitnami compiles the PHP binary, it includes OpenSSL within the generated bundle).

I have launched a brand new instance using the AMI identifier you provided and when I list the enabled modules you can spot OpenSSL:

$ php -m | grep ssl
openssl

…even though the *.so for OpenSSL is not in the directory:

$  ls /opt/bitnami/php/lib/php/extensions/ | grep ssl

As a result, you don’t need to comment out the extension=openssl in your php.ini file, it is already activated! :slightly_smiling_face:

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

1 Like