数据库连接SQLSRV

时间:2016-05-04 04:26:50

标签: php 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到ext文件夹。

任何帮助都会受到赞赏

1 个答案:

答案 0 :(得分:1)

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

extension=php_sqlsrv_56_ts.dll

干杯!

相关问题