Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1' : file not found #1002

Closed
matfiz opened this issue Jun 13, 2019 · 6 comments

Comments

@matfiz
Copy link

matfiz commented Jun 13, 2019

PHP Driver version or file name

Microsoft ODBC Driver 17 for SQL Server, sqlsrv-5.6.1

Client operating system

Ubuntu 16.04

PHP version

7.3

Problem description

I've installed drivers using PECL (pecl install pdo_sqlsrv sqlsrv), while trying to:

sqlcmd -S <server_ip> -U <user_name> -P <pass>
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1' : file not found.

The same error when I try to access the server through PHP. The file exists and is accessible by all:

ls -al /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1
-rwxr-xr-x 1 root root 2046672 Feb 12 21:08 /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1

All library dependencies are met:

ldd /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1
    linux-vdso.so.1 =>  (0x00007ffd0c14b000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4fd9349000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f4fd9141000)
    libodbcinst.so.2 => /usr/lib/x86_64-linux-gnu/libodbcinst.so.2 (0x00007f4fd8f26000)
    libcrypto.so.1.0.2 => not found
    libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f4fd8c54000)
    libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f4fd8a0a000)
    libssl.so.1.0.2 => not found
    libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f4fd8805000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f4fd8422000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4fd8119000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f4fd7f01000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4fd7ce4000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4fd791a000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f4fd9954000)
    libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f4fd76eb000)
    libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f4fd74e7000)
    libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f4fd72dc000)
    libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f4fd70d8000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f4fd6ebd000)
@yitam
Copy link
Contributor

yitam commented Jun 13, 2019

HI @matfiz, how did you install ODBC and/or mssql tools? Did you follow the instructions on the documentation?

Maybe you can try to uninstall them first? Can you reproduce the same problem in a clean Ubuntu 16.04?

@matfiz
Copy link
Author

matfiz commented Jun 14, 2019

Thank's for an answer, @yitam. I have uninstalled all MS-ODBC related packages and installed them again and it actually helped. I'm closing the issue.

@matfiz matfiz closed this as completed Jun 14, 2019
@vedmant
Copy link

vedmant commented Jul 15, 2019

I have the same issue, but I use docker container and everything is installed from scratch. The issue started when I rebuilt docker container, looks like php:7.2-fpm changed from debian stretch to buster, maybe that's the issue.

@yitam
Copy link
Contributor

yitam commented Jul 15, 2019

Thanks @vedmant for the info. You might need to move back to debian stretch or wait for the next release of ODBC driver. Please stay tuned.

@piotrgulbis
Copy link

Verified that this is due to php:php-fpm moving to 'buster'. In the meantime you can for example use php:7.3-fpm-stretch and it should work as before.

@yitam
Copy link
Contributor

yitam commented Aug 7, 2019

FYI, ODBC driver 17.4 is released with instructions updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants