Because the company needs to, so need to access SQL Server 2012 in the Linux environment, my local debug system is the CentOS
The PHP environment has been set up and the PDO extension, ODBC extension
Unixodbc and FreeTDS are also installed.
Now the problem is that I pass MSSQL
Connect and ODBCConnect two is normally accessible to SQL Server 2012 and is able to take out the appropriate data
But when I tried to use the ODBC under the PDO to read it, there was a problem and it never succeeded.
The error message is as follows:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[08S01] SQLDriverConnect: 20009 [unixODBC][FreeTDS][SQL Server]Unable to connect: Adaptive Server is unavailable or does not exist'
Find a degree Niang and Google asked for a long time, has been unable to solve this problem, ask who know the reason?
Reply content:
Because the company needs to, so need to access SQL Server 2012 in the Linux environment, my local debug system is the CentOS
The PHP environment has been set up and the PDO extension, ODBC extension
Unixodbc and FreeTDS are also installed.
The problem now is that I have access to SQL Server 2012 through the MSSQLConnect and ODBCconnect two ways, and I am able to retrieve the corresponding data
But when I tried to use the ODBC under the PDO to read it, there was a problem and it never succeeded.
The error message is as follows:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[08S01] SQLDriverConnect: 20009 [unixODBC][FreeTDS][SQL Server]Unable to connect: Adaptive Server is unavailable or does not exist'
Find a degree Niang and Google asked for a long time, has been unable to solve this problem, ask who know the reason?
Are you sure that your PHP installation directory ext extension directory has a. dll file for SQL Server that is a. dll suffix on windows
LZ solved it? Welcome to share a solution!