php starup sqlsrv无法初始化模块

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12154738/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 02:57:12  来源:igfitidea点击:

php starup sqlsrv unable to initialize module

phpsqlsql-server

提问by Illep

I am trying to connect MSSQL to PHP. i am following thistutorial. Anyway after i added the dll files as described in that tutorial, i get the following warning. How can i solve this ?

我正在尝试将 MSSQL 连接到 PHP。我正在关注教程。无论如何,在我按照该教程中的描述添加了 dll 文件后,我收到以下警告。我该如何解决这个问题?

php starup sqlsrv unable to initialize module module compiled with module api=20090626 php compiled with module api=20020520 these options need to match

note:i have gone through this postbut none helped.

注意:我已经阅读了这篇文章,但没有任何帮助。

回答by VolkerK

Looks like you've tried to install the sqlsrv extension for php 5.3 on a php 5.2 system.

看起来您已经尝试在 php 5.2 系统上安装 php 5.3 的 sqlsrv 扩展。

Either run <?php phpinfo(); ?>and look for the php version and look for the following entries:

运行<?php phpinfo(); ?>并查找 php 版本并查找以下条目:

  • PHP Version
  • Thread Safety
  • PHP版本
  • 线程安全

pick the appropriate .dll from the sqlsrv driver: the version number must match and if thread safety is enabled pick the ts version, if not pick the nts version.

从 sqlsrv 驱动程序中选择适当的 .dll:版本号必须匹配,如果启用了线程安全,则选择 ts 版本,否则选择 nts 版本。

回答by Simon Francesco

For anyone trying to get it to work with PHP 5.5 (PHP compiled with module API=20121212) then you can replace the dlls in the ext folder with new updated binaries >here<

对于任何试图让它与 PHP 5.5(PHP 使用模块 API=20121212 编译的)一起工作的人,你可以用新的更新的二进制文件替换 ext 文件夹中的 dll >here<

Don't forget to enable the new dlls in the php configuration.

不要忘记在 php 配置中启用新的 dll。