msphpsql icon indicating copy to clipboard operation
msphpsql copied to clipboard

PHP Warning: PHP Startup: Unable to load dynamic library 'sqlsrv.so'

Open Kat35601 opened this issue 2 years ago • 1 comments

PHP 8.1.7 (cli) (built: Jun 25 2022 08:12:59) (NTS)

Not sure the version. I ran sudo pecl install sqlsrv sudo pecl install pdo_sqlsrv

Instructions from "https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-ver16"

Linux Mint 20.3

Error PHP Warning: PHP Startup: Unable to load dynamic library 'sqlsrv.so' (tried: /usr/lib/php/20210902/sqlsrv.so (/usr/lib/php/20210902/sqlsrv.so: cannot open shared object file: No such file or directory), /usr/lib/php/20210902/sqlsrv.so.so (/usr/lib/php/20210902/sqlsrv.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlsrv.so' (tried: /usr/lib/php/20210902/pdo_sqlsrv.so (/usr/lib/php/20210902/pdo_sqlsrv.so: cannot open shared object file: No such file or directory), /usr/lib/php/20210902/pdo_sqlsrv.so.so (/usr/lib/php/20210902/pdo_sqlsrv.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PHP 8.1.7 (cli) (built: Jun 25 2022 08:12:59) (NTS)

/etc/php/8.1/mods-available/sqlsrv.ini ; priority=20 extension=sqlsrv.so

/etc/php/8.1/mods-available/pdo_sqlsrv.ini ; priority=30 extension=pdo_sqlsrv.so

neither file sqlsrv.so or pdo_sqlsrv.so on on my computer anyware.

I have attempted to remove and reinstall

Kat35601 avatar Jun 29 '22 15:06 Kat35601

Hi, we don't officially support Linux Mint. Here's the Support Matrix.

absci avatar Jul 11 '22 16:07 absci

I have the same issue on windows 10 for the same files with .dll extension ticket_sqlsrv_cmd

Here is my php.ini (in the php folder): ticket_sqlsrv_phpini and the dll files are located in the ext/ folder of PHP.

It's just a warning, not an error but when I try to connect to my SQL Server database using symfony, I got this: ticket_sqlsrv_symfony_cmd

I'm getting mad because I can't understand the issue and all the people who have solved this problem seems to just have put the files in ext/ folder, change their php.ini file.

Fodba avatar Oct 13 '22 12:10 Fodba

Can you enable logging in php.ini? (display_errors = on) It may be useful to see which exact dll it is trying to load.

v-makouz avatar Oct 17 '22 22:10 v-makouz

I don't know how or why but the warning no longer appears. I didn't do anything. If you have any explanations, I would like to know.

ticket_sqlsrv_cmd2

Now I have a new message is about sqlsrv_configure. But I'm going to look around for a solution. Thanks and sorry for your time.

Fodba avatar Oct 24 '22 08:10 Fodba