kat35601 Posted August 4, 2016 Share Posted August 4, 2016 I am trying to connect to Microsoft SQL Server but I get Fatal error: Call to undefined function odbc_connect() in: connect =odbc_connect("kfm1","sa","removed"); if(!$connect) { exit("Connection Failed: " . $connect); } I can connect with tsql -S sqlserver -U xxxxxxxxx -P xxxxxxxxx and with osql -S kfm1 -U xxxxxxxxx -P xxxxxxxxx using the odbc.ini Below is the setup. Centos 6.8 Cpanel::Easy::Apache v3.32.13 rev9999 PHP 5.5.35 freetds v1.00.13 Freetds.conf looks like this [sqlserver] host = IP address removed port = 1433 tds version = 8.0 /*******************/ odbc.ini [kfm1] Driver=FreeTDS Servername=sqlserver Database =M1_KF TDS_Version = 8.0 /********************/ odbcinst.ini [FreeTDS] Description = FreeTDS unixODBC Driver Driver = /usr/lib64/libtdsodbc.so Setup = /usr/lib64/libtdsS.so CPTImeout= COReuse= FileUsag=1 Trace = Yes TraceFile = /tmp/sql.log ForceTrace = Yes /****************************************/ Quote Link to comment https://forums.phpfreaks.com/topic/301756-fatal-error-call-to-undefined-function-odbc_connect-in/ Share on other sites More sharing options...
requinix Posted August 4, 2016 Share Posted August 4, 2016 Then that means you don't have the ODBC extension installed. Wherever you got PHP 5.5 probably also has a php-odbc package for it. Quote Link to comment https://forums.phpfreaks.com/topic/301756-fatal-error-call-to-undefined-function-odbc_connect-in/#findComment-1535598 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.