Closed drupal-daffie closed 2 years ago
Do they work on php7.4?
It fails with PHP 7.4 with the following result:
daffie@ddev-93mssql-web:/var/www/html/web$ php -v
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlsrv.so' (tried: /usr/lib/php/20190902/pdo_sqlsrv.so (/usr/lib/php/20190902/pdo_sqlsrv.so: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/pdo_sqlsrv.so.so (/usr/lib/php/20190902/pdo_sqlsrv.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlsrv.so' (tried: /usr/lib/php/20190902/pdo_sqlsrv.so (/usr/lib/php/20190902/pdo_sqlsrv.so: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/pdo_sqlsrv.so.so (/usr/lib/php/20190902/pdo_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 'sqlsrv.so' (tried: /usr/lib/php/20190902/sqlsrv.so (/usr/lib/php/20190902/sqlsrv.so: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/sqlsrv.so.so (/usr/lib/php/20190902/sqlsrv.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'sqlsrv.so' (tried: /usr/lib/php/20190902/sqlsrv.so (/usr/lib/php/20190902/sqlsrv.so: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/sqlsrv.so.so (/usr/lib/php/20190902/sqlsrv.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.4.26 (cli) (built: Nov 22 2021 09:49:28) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.26, Copyright (c), by Zend Technologies
Did you follow the instructions in https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-ver15#step-3-install-the-php-drivers-for-microsoft-sql-server-ubuntu-with-php-fpm for 7.4 and 8.0?
I confirm your experience with PHP7.4 using the instructions in https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-ver15#step-3-install-the-php-drivers-for-microsoft-sql-server-ubuntu-with-php-fpm
I followed the instructions and I got the fail.
I can confirm this issue. A work around is after change version to 8.0 do pecl uninstall sqlsrv pdo_sqlsrv
and then pecl install sqlsrv pdo_sqlsrv
. We'll look into the possibilities of having pecl compile for different PHP versions.
@absci: Thank you!
I did some research and I think it's not possible to let Pecl compile for all php versions during one install. But I found a solution here. I have both 8.0 and 8.1 installed on my machine.
sudo pecl -d php_suffix=8.1 install sqlsrv
sudo pecl uninstall -r sqlsrv
sudo pecl -d php_suffix=8.0 install sqlsrv
sudo pecl uninstall -r sqlsrv
After that both php versions can use sqlsrv extension.
Please check the FAQ (frequently-asked questions) first. If you have other questions or something to report, please address the following (skipping questions might delay our responses):
PHP version 8.0
PHP SQLSRV or PDO_SQLSRV version 5.10.0
Microsoft ODBC Driver version 18
SQL Server version Not important
Client operating system Debian 11
Table schema Not important
Problem description
I have changed the default PHP version from 8.1 to 8.0. When I run
php -v
it returns to me that I am running version 8.0. I then install the packages sqlsrv and pdo_sqlsrv, like:When I than run
php -v
I get the following warning:Installing it for PHP 8.1 works great. Thank you for that.
Expected behavior and actual behavior Make it compile for PHP 8.0 and PHP 7.4
Repro code or steps to reproduce See Problem description and I am using PHP from https://deb.sury.org/ with multiple versions of PHP.