0

I have a library ( ZendDebugger.so ) which in turn requires the openssl library but it doesn't find a reference to it.

Indeed when ZendDebugger.so loads, it prints this error on the error log ( which is the Apache error_log file in my case ):

Failed loading /usr/lib64/php/7.1/modules/ZendDebugger.so:  
libssl.so.1.0.0: cannot open shared object file: 
No such file or directory

Then i tried installing openssl:

 sudo yum install openssl
 Loaded plugins: priorities, update-motd, upgrade-helper
 amzn-main       | 2.1 kB  00:00:00
 amzn-updates   | 2.3 kB  00:00:00
 Package 1:openssl-1.0.1k-15.99.amzn1.x86_64 already installed and latest version
 Nothing to do

Looks like there is already a custom openssl installed, in this case an Amazon version. So i may want to do something like:

cd /usr/lib64 
ln /path/to/amazon/openssl/openssl-1.0.1k-15.99.amzn1.x86_64.so libssl.so

In that way i would create a shared library that gets automatically seen by ZendDebugger.so, since it would be created in /usr/lib64 which is one of the default directories where the executables go to look for their libraries.

But before that, i need to know the path for the openssl-1.0.1k-15.99.amzn1.x86_64 file :

sudo find / openssl-1.0.1k-15.99.amzn1.x86_64
.... 
....
find: `openssl-1.0.1k-15.99.amzn1.x86_64': No such file or directory

What am i missing? How can i find the path for the Amazon openssl ? Or do you have any other solution? Thanks

2 Answers 2

1

RPMs are always split up into areas of concern. They're typically named:

<pkg>.<arch>
<pkg>-devel.<arch>
<pkg>-libs.<arch>

Where <pkg> would be openssl and <arch> will i686 or x86_64. There are other architectures but these are the common ones on AMD/Intel hardware so we'll stick to just those for this discussion.

The actual tools that comprise the openssl software are included in the RPM openssl.x86_64. Notice how the name of this RPM conforms to the patterns I showed above?

The libraries (.so) are in this RPM, openssl-libs.x86_64 while the header files (.h) are in this RPM, openssl-devel.x86_64.

So your issue is you haven't actually installed the library or header files so that your package can compile and link against the openssl package.

Try this:

$ yum search openssl | grep ^openssl
openssl-devel.i686 : Files for development of applications which will use
openssl-devel.x86_64 : Files for development of applications which will use
openssl-perl.x86_64 : Perl scripts provided with OpenSSL
openssl-pkcs11.x86_64 : A PKCS#11 engine for use with OpenSSL
openssl-static.i686 : Libraries for static linking of applications which will
openssl-static.x86_64 : Libraries for static linking of applications which will
openssl.x86_64 : Utilities from the general purpose cryptography library with
openssl-libs.x86_64 : A general purpose cryptography library with TLS
openssl-libs.i686 : A general purpose cryptography library with TLS
openssl098e.i686 : A compatibility version of a general cryptography and TLS
openssl098e.x86_64 : A compatibility version of a general cryptography and TLS

Now to install them:

$ sudo yum install -y openssl-{devel,libs}

Once installed you can confirm the contents of the openssl-libs RPM:

$ rpm -ql openssl-libs | grep libssl.so
/usr/lib64/.libssl.so.1.0.2k.hmac
/usr/lib64/.libssl.so.10.hmac
/usr/lib64/libssl.so.1.0.2k
/usr/lib64/libssl.so.10

What if I don't know what RPM to install?

This is a common question that I see all the time. Most people that are either new to Redhat distros such as Fedora/CentOS/RHEL are unaware of the repoquery command line tool. With this tool you can query remote YUM repositories and look for what packages provide a given file.

So in your scenario:

$ repoquery -qf */libssl.so*
openssl-libs-1:1.0.2k-12.el7.x86_64
openssl-devel-1:1.0.2k-12.el7.x86_64
openssl098e-0:0.9.8e-29.el7.centos.3.i686
openssl-libs-1:1.0.2k-12.el7.i686
openssl-devel-1:1.0.2k-12.el7.i686

We can see that the libssl.so* file is included with all the above RPMs. So based on your existing RPM, you'd likely want these 2:

openssl-libs-1:1.0.2k-12.el7.x86_64
openssl-devel-1:1.0.2k-12.el7.x86_64

NOTE: Keep in mind that I'm showing you CentOS 7.x packages, you're using Amazon's AMI which is their own branded package of CentOS, so the names are slightly different, but the process I've shown you should be identical, regardless.

1
  • 1
    Thanks, but it failed saying that openssl is already installed and up-to-date, the same error i reported in my question when i tried "sudo yum install openssl". Anyway i managed to create a hard link to the openssl i already have installed, and that was enough ( see my own answer )
    – HelloWorld
    Commented Jul 14, 2018 at 23:57
0

Turns out that i had the libssl library in /usr/lib64 , just with a different file name than the one ZendDebugger expects ( libssl.so.1.0.0 ). So i have just created an hard link to it with the right file name :

[ec2-user@ip-172-31-4-60 ~] cd /usr/lib64
[ec2-user@ip-172-31-4-60 lib64] ls -la libssl*
-rwxr-xr-x 1 root root 303520 Jun 22  2017 libssl3.so
lrwxrwxrwx 1 root root     16 Sep 20  2017 libssl.so -> libssl.so.1.0.1k
lrwxrwxrwx 1 root root     16 Aug 13  2017 libssl.so.10 -> libssl.so.1.0.1k
-rwxr-xr-x 2 root root 449616 Feb 28  2017 libssl.so.1.0.1k
[ec2-user@ip-172-31-4-60 lib64] sudo ln libssl.so.1.0.1k libssl.so.1.0.0

and now it works!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .