Edit report at https://bugs.php.net/bug.php?id=74477&edit=1
ID: 74477
Updated by: adambaratz@php.net
Reported by: fuzzywy at 163 dot com
Summary: can not connect to sybase with pdo_dblib
Status: Feedback
Type: Bug
Package: PDO DBlib
Operating System: centos7
PHP Version: 7.1.4
Block user comment: N
Private report: N
New Comment:
Are you familiar with TDSDUMP environment variable?
http://www.freetds.org/userguide/logging.htm
Try doing this for both PHP versions:
TDSDUMP="freetds.log" php -r "new
PDO('dblib:host=7.140.28.88:26401;dbname=dwhdb','dcbo','dcbo');"
If you share both log files, I might be able to help debug.
Previous Comments:
------------------------------------------------------------------------
[2017-04-25 00:56:46] fuzzywy at 163 dot com
I've been aware of the issue so i checked the source code in 5.5.15
(in which version my program works well).
https://github.com/php/php-src/blob/PHP-5.5.15/ext/pdo_dblib/dblib_driver.c
It's same as the code in 7.1.4 that there's a comment in version 5.0ã
And i also test it in 7.0.x, change the global tds version in my freetds.conf to 4.2, both can not
workã
------------------------------------------------------------------------
[2017-04-24 18:59:01] adambaratz@php.net
Is it possible to use a different TDS version? There's a comment in the source suggesting that
5.0 isn't supported:
https://github.com/php/php-src/blob/PHP-7.1.4/ext/pdo_dblib/dblib_driver.c#L312
If that doesn't work, it would help to know if this was a regression between PHP versions. I
don't have a local instance of Sybase, so this may be difficult to help debug, but that might
point the way.
------------------------------------------------------------------------
[2017-04-20 07:45:27] fuzzywy at 163 dot com
Description:
------------
The problem is that i can connect sybase with freetds, while pdo_dblib get error.
===
freetds.conf
[sybase]
host = 7.140.28.88
port = 26401
tds version = 5.0
===
test script
php -r "new
PDO('dblib:host=7.140.28.88:26401;dbname=dwhdb','dcbo','dcbo');"
Expected result:
----------------
connect to sybase server
Actual result:
--------------
PDOException thrown
Fatal error: Uncaught PDOException: SQLSTATE[HY000] General SQL Server error: Check messages from
the SQL Server (severity 15) in Command line code:1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74477&edit=1