所以我在IIS上有一个codeigniter项目,并在我的linux dev机器上克隆了它。它给了我一个空白的白色屏幕我确定是因为我使用ODBC驱动程序并没有安装php-odbc。我纠正了这一点,现在我收到以下错误:
Message: odbc_connect(): SQL error: [unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found, SQL state 01000 in SQLConnect
我是odbc驱动程序的新手,所以除了yum install php-odbc之外,我很可能错过设置的一步。
PHP信息:
odbc
ODBC Support => enabled
Active Persistent Links => 0
Active Links => 0
ODBC library => unixODBC
ODBC_INCLUDE => -I/usr/include
ODBC_LFLAGS => -L/usr/lib64
ODBC_LIBS => -lodbc
Directive => Local Value => Master Value
odbc.allow_persistent => On => On
odbc.check_persistent => On => On
odbc.default_cursortype => Static cursor => Static cursor
odbc.default_db => no value => no value
odbc.default_pw => no value => no value
odbc.default_user => no value => no value
odbc.defaultbinmode => return as is => return as is
odbc.defaultlrl => return up to 4096 bytes => return up to 4096 bytes
odbc.max_links => Unlimited => Unlimited
odbc.max_persistent => Unlimited => Unlimited
freetds.conf:
[CrmSqlServer]
host = 10.1.*******
port = 1433
tds version = 9.0
ODBCINST.INI:
[TDS]
Driver = /usr/lib64/libtdsodbc.so
Description = FreeTDS driver
Setup = /usr/lib64/libtdsS.so
ODBC.INI:
[CrmSqlServer]
Driver = TDS
Description = My Server
ServerName = CrmSqlServer
Database = ******_CRM2011
TSQL:
tsql -S CrmSqlServer -U mshreport
#success
osql / isql:
isql CrmSqlServer user password -v
-bash: !9: event not found
codeigniter config:
$db['sql']['hostname'] = 'DRIVER={TDS};SERVER=10.1.*******;DATABASE=**************_CRM2011;UID=username;PWD=password';
$db['sql']['username'] = 'username';
$db['sql']['password'] = 'password';
$db['sql']['database'] = '*************_CRM2011';
$db['sql']['dbdriver'] = 'odbc';
$db['sql']['dbprefix'] = '';
$db['sql']['pconnect'] = TRUE;
$db['sql']['db_debug'] = TRUE;
$db['sql']['cache_on'] = FALSE;
$db['sql']['cachedir'] = '';
$db['sql']['char_set'] = 'utf8';
$db['sql']['dbcollat'] = 'utf8_general_ci';
$db['sql']['swap_pre'] = '';
$db['sql']['autoinit'] = TRUE;
$db['sql']['stricton'] = FALSE;
odbc错误:
odbc_pconnect(): SQL error: [unixODBC][FreeTDS][SQL Server]Unable to connect to data source, SQL state S1000 in SQLConnect
更新
我已将之前的3次更新转换为上述更具体的信息。
不确定这是否有帮助,但我现在完全陷入困境。