You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just had a closer look at https://github.com/php/php-src/blob/master/ext/pdo_dblib/config.w32, and found it amazing that you can build the same DLL with two different names by just configuring --with-pdo-dblib and --with-pdo-mssql, if you manage to get the appropriate dependencies. That appears to be a problem, though, since FreeTDS claims to be a set of libraries for Unix and Linux, and to my knowlegde Sybase and Microsoft SQL Server are no longer compatible for decades. Furthermore, it occurs to me that pdo_sqlsrv is preferred to work with MS SQL Server for many years, and I can hardly imagine that anybody still uses pdo_mssql to connect to an SAP ASE (what it's apparently called since 2010).
For what it's worth, the official Windows builds neither contain php_pdo_dblib.dll nor php_pdo_mssql.dll for a long time.
So, can anyone shed some light on the state of pdo_dblib on Windows? Does anybody still use it? Can it even be built?
If not, I suggest to drop support for pdo_dblib on Windows altogether (i.e. remove config.w32 and the couple of Windows specific code in the C sources of the extension). And yes, this requires discussion on the internals and internals-win mailing lists, and possibly an RFC, but I wanted to gauge the feedback on this ticket first.
It's pretty rare to see people connecting to Sybase using dblib, but that's what I've seen at least this year.
Yeah, I suppose that pdo_dblib works on Linux/Unix systems using FreeTDS. The question is if pdo_dblib/pdo_mssql is still supported on Windows. I would download that "free" trial, if it was free.
There is only one php_dblib.dll on my laptop, for a X64 (!) PHP 5.3.8. And one php_pdo_dblib.dll for a X64 PHP 5.3.28, which is dependent on libsybdb64.dll (Sybase). So it is fairly safe to drop support for pdo_dblib. on Windows.
If it is not possible to use SqlSrv, you can use the PDO_ODBC driver to connect to Microsoft SQL Server and Sybase databases, as the native Windows DB-LIB is ancient, thread un-safe and no longer supported by Microsoft.
So, indeed, dropping support for pdo_dblib on Windows (and only on Windows) appears to be sensible.
I've looked into it for a while now and I think it's okay to drop it.
Thanks! I agree, also considering that there has been no feedback on https://news-web.php.net/php.internals/124777. However, I don't consider this urgent, and since we're already late in the PHP 8.4 QA release cycle, I suggest to postpone this to PHP next (i.e. 8.5 or 9.0).
php pdo dblib and freetds appears to be the ONLY way to connect to some legacy MS SQL Servers from current Linux versions due to OpenSSL version problems with sqlsrv and MS drivers which result in error 0x2746 and which of late, are not fixed by this solution: microsoft/msphpsql#1453
This may be relevant in the context of Windows long term....
I didn't know it was possible connect to SQL Server from php pdo on Linux via odbc and pdo_odbc without MS php pdo drivers or freetds/dblib ? If it is possible, please point me in the right direction !
Activity
SakiTakamachi commentedon Jul 31, 2024
@cmb69
It's pretty rare to see people connecting to Sybase using dblib, but that's what I've seen at least this year.
#13475
However, for SqlServer there is pdo_sqlsrv as you mentioned, and even if not odbc tends to be preferred.
I've never built this on windows so I don't know about that.
I'll check once to see what the difference is between building it as mssql and building it as dblib.
cmb69 commentedon Jul 31, 2024
Yeah, I suppose that pdo_dblib works on Linux/Unix systems using FreeTDS. The question is if pdo_dblib/pdo_mssql is still supported on Windows. I would download that "free" trial, if it was free.
SakiTakamachi commentedon Aug 5, 2024
I've looked into it a bit, but I haven't found any useful information yet...
cmb69 commentedon Aug 5, 2024
@Jan-E, did you ever try to build pdo_dblib on Windows (either using
--with-pdo-dblibor--with-pdo-mssql)?Jan-E commentedon Aug 5, 2024
There is only one php_dblib.dll on my laptop, for a X64 (!) PHP 5.3.8. And one php_pdo_dblib.dll for a X64 PHP 5.3.28, which is dependent on libsybdb64.dll (Sybase). So it is fairly safe to drop support for pdo_dblib. on Windows.
cmb69 commentedon Aug 5, 2024
Thank, @Jan-E! That helped me to find https://php-legacy-docs.zend.com/manual/php5/en/ref.pdo-dblib:
So, indeed, dropping support for pdo_dblib on Windows (and only on Windows) appears to be sensible.
PS: hah, it's still in "our" docs: https://www.php.net/pdo_dblib
cmb69 commentedon Aug 5, 2024
I've written to the mailing list: https://news-web.php.net/php.internals/124777 (but forgot to actually include the Windows internals mailing list; maybe not an issue).
SakiTakamachi commentedon Aug 31, 2024
I've looked into it for a while now and I think it's okay to drop it.
cmb69 commentedon Aug 31, 2024
Thanks! I agree, also considering that there has been no feedback on https://news-web.php.net/php.internals/124777. However, I don't consider this urgent, and since we're already late in the PHP 8.4 QA release cycle, I suggest to postpone this to PHP next (i.e. 8.5 or 9.0).
clarumedia commentedon May 24, 2026
php pdo dblib and freetds appears to be the ONLY way to connect to some legacy MS SQL Servers from current Linux versions due to OpenSSL version problems with sqlsrv and MS drivers which result in error 0x2746 and which of late, are not fixed by this solution: microsoft/msphpsql#1453
This may be relevant in the context of Windows long term....
SakiTakamachi commentedon Jun 3, 2026
@clarumedia
Are odbc and pdo_odbc unavailable as well?
clarumedia commentedon Jun 3, 2026
I didn't know it was possible connect to SQL Server from php pdo on Linux via odbc and pdo_odbc without MS php pdo drivers or freetds/dblib ? If it is possible, please point me in the right direction !