Jump to content

Fatal error: Call to undefined function odbc_connect() in


Recommended Posts

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
 
/****************************************/
 
 
 
Link to post
Share on other sites
This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.