I have successfully installed PHP 8.2 on Ubuntu 20.04. I am trying to add the SQLSRV extension following these directions.
The installation for SQLSRV
completes successfully.
However, when I try to run a function in PHP using SQLSRV
extension, I get the error:
"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)"
As the error reports, the /usr/lib/php/20220829/ directory does not contain the sqlsrv.so file. Instead the SQLSRV installation places the sqlsrv.so file to the /usr/lib/php/20210902/ directory.
Both the sqlsrv.so and pdo_sqlsrv.so files are automatically installed to the ‘20210902’ directory.
I have tried moving the sqlsrv files to the ‘20220829’ directory, but then I receive an error that I am trying to load two different versions of PHP, ‘20210902’ and ‘20210902’.
Any help to get these extensions working properly would be great!
Listed above are the steps I tried.
3
Answers
As of Jan 1st 2023, according to Microsofts Main PHP developers , PHP8.2 is not yet supported.
It has been released at the end of January as a beta for now.
You can find it here:
https://github.com/microsoft/msphpsql/releases
Official release 5.11 from Microsoft is out now, compliant with PHP 8.2
https://learn.microsoft.com/en-us/sql/connect/php/download-drivers-php-sql-server