Sorry if this is a repeat of another question; my searches failed to find a direct solution to my problem.
Just now, my machine updated PHP to v8.2. Since then, I have been unable to run the SQL Server extension.
After some trial and error, I got the INI files copied to the new folder, as confirmed by php -i
(trimmed for brevity):
/etc/php/8.2/cli/conf.d/20-sockets.ini,
/etc/php/8.2/cli/conf.d/20-sqlsrv.ini,
/etc/php/8.2/cli/conf.d/20-sysvmsg.ini,
...
/etc/php/8.2/cli/conf.d/20-xsl.ini,
/etc/php/8.2/cli/conf.d/30-pdo_sqlsrv.ini
When I run php -i
, this warning appears:
PHP Warning: PHP Startup: Unable to load dynamic library 'sqlsrv.so' (tried: /usr/lib/php/20220829/sqlsrv.so (/usr/lib/php/20220829/sqlsrv.so: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/sqlsrv.so.so (/usr/lib/php/20220829/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/20220829/pdo_sqlsrv.so (/usr/lib/php/20220829/pdo_sqlsrv.so: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/pdo_sqlsrv.so.so (/usr/lib/php/20220829/pdo_sqlsrv.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Okay... I can find the files manually:
/usr/lib/php find . -name sqlsrv*
./20210902/sqlsrv.so
/usr/lib/php find . -name pdo_sqlsrv*
./20210902/pdo_sqlsrv.so
Clearly they aren't where PHP is looking for them. But how do I make PHP find them?