Getting the following error when testing an upgrade to PHP7 x64:
odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
I've installed the following:
- PHP 7.0.0 x64
- Microsoft ODBC Driver 11 for SQL Server x64
- Microsoft Visual C++ 2015 Redistributable x64
- Microsoft Visual C++ 2015 Redistributable x86
- The (thread-safe) preview of the PHP 7 MSSQL drivers: https://github.com/Azure/msphpsql
I have uncommented/added the following lines of my phpini:
- extension=php_pdo_mysql.dll (uncommented)
- extension=php_odbc.dll (added)
- extension=php_sqlsrv_7_ts.dll (added)
- extension=php_pdo_sqlsrv_7_ts.dll (added)
Things to consider:
- I can see that the modules are indeed loaded in phpinfo.
- I've added the ODBC connection and can see it in System DSN.
- I am successfully able to connect via sqlsrv_connect() but not odbc_connect(), which is what all our previous PHP 5.6 scripts are using.
Can't seem to find the answer anywhere else. Any help would be appreciated. Thanks.