数据库连接SQLSRV


Database connect SQLSRV

我正在尝试将codeigniter连接到sql server 2008。我的PHP版本PHP Version 5.6.14

我得到这个错误。在PHP_ERROR_LOG

[04-May-2016 04:19:50 UTC] PHP Warning:  PHP Startup: pdo_sqlsrv: Unable to initialize module
Module compiled with module API=20100525
PHP    compiled with module API=20131226
These options need to match
 in Unknown on line 0
[04-May-2016 04:19:50 UTC] PHP Warning:  PHP Startup: sqlsrv: Unable to initialize module
Module compiled with module API=20100525
PHP    compiled with module API=20131226
These options need to match
 in Unknown on line 0
[04-May-2016 04:19:51 UTC] PHP Warning:  PHP Startup: pdo_sqlsrv: Unable to initialize module
Module compiled with module API=20100525
PHP    compiled with module API=20131226
These options need to match
 in Unknown on line 0
[04-May-2016 04:19:51 UTC] PHP Warning:  PHP Startup: sqlsrv: Unable to initialize module
Module compiled with module API=20100525
PHP    compiled with module API=20131226
These options need to match
 in Unknown on line 0

我把这个php_sqlsrv_56_nts.dll&php_sqlsrv_56_ts.dll到下一个文件夹。

如有任何帮助,将不胜感激

您不必同时使用这两个文件,末尾带有ts的文件意味着线程安全,您可以使用它。此外,您还需要在php.ini文件中添加以下行:

extension=php_sqlsrv_56_ts.dll

干杯!