I need to connect to the MS SQLServer 2008 service with PHP on Ubuntu, and I would like to do this using PDO. I believe that I have installed all the necessary libraries, and I can really connect using tsql on the command line and using mssql_connect() in the code. I canβt understand what DSN itself is, or if there are any additional PDO configuration steps that Iβm missing.
I use the following DSN (where the $db* variables are populated with the appropriate values):
odbc:Driver=FreeTDS;SERVER=$dbServer;DATABASE=$dbSchema;UID=$dbUser;PWD=$dbPasswd"
My error message:
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[IM002] SQLDriverConnect: 0 [unixODBC][Driver Manager]Data source name not found, and no default driver specified' in /home/timothy/test.php:4 Stack trace: #0 /home/timothy/test.php(4): PDO->__construct('odbc:Driver=Fre...') #1 {main} thrown in /home/timothy/test.php on line 4
What additional configuration steps did I see?
Thanks in advance.
source share