加载 SQL Server 2008 Express 的 PHP 驱动程序时出现问题

发布于 2024-08-07 09:10:08 字数 2046 浏览 1 评论 0原文

我正在尝试使用 MS SQL Server 1.0 版的 PHP 驱动程序。

我已完成所有设置,但我认为加载扩展 php_sqlsrv_ts.dll 时遇到问题。我已进入命令行并尝试以下操作:

C:\wamp\bin\php\php5.3.0>php.exe --re sqlsrv
Exception: Extension sqlsrv does not exist

C:\wamp\bin\php\php5.3.0>php.exe --re sqlsrv_ts
Exception: Extension sqlsrv_ts does not exist

在我的 PHP.ini 中 - 我已

;extension=php_sqlsrv.dll
extension=php_sqlsrv_ts.dll

启用线程安全,因此使用 php_sqlsrv_ts.dll。我的 extension_dir 是正确的,因为我从那里加载其他模块。我也有 Microsoft Native CLient 2008。每次我尝试运行我的 PHP 脚本时,我都会得到:

Fatal error: Call to undefined function sqlsrv_connect()

它一定与未加载的模块有关。我可以获取 MySQL 的所有扩展信息,但不能获取 sqlsrv 扩展的信息。

我怎样才能让 PHP 加载这个扩展?

感谢所有

编辑

Apache_Error_log:

PHP Warning:  PHP Startup: sqlsrv: Unable to initialize module\nModule compiled with module API=20060613\nPHP    compiled with module API=20090626\nThese options need to match\n in Unknown on line 0
PHP Warning:  Module 'xmlrpc' already loaded in Unknown on line 0
[Tue Oct 13 14:51:16 2009] [notice] Apache/2.2.11 (Win32) PHP/5.3.0 configured -- resuming normal operations
[Tue Oct 13 14:51:16 2009] [notice] Server built: Dec 10 2008 00:10:06
[Tue Oct 13 14:51:16 2009] [notice] Parent: Created child process 11916
PHP Warning:  PHP Startup: sqlsrv: Unable to initialize module\nModule compiled with module API=20060613\nPHP    compiled with module API=20090626\nThese options need to match\n in Unknown on line 0
<br />
<b>Warning</b>:  PHP Startup: sqlsrv: Unable to initialize module
Module compiled with module API=20060613
PHP    compiled with module API=20090626
These options need to match
 in <b>Unknown</b> on line <b>0</b><br />
PHP Warning:  Module 'xmlrpc' already loaded in Unknown on line 0
<br />
<b>Warning</b>:  Module 'xmlrpc' already loaded in <b>Unknown</b> on line <b>0</b><br />

I am trying to make use of the PHP driver for MS SQL Server version 1.0.

I have everything setup but I think I am having trouble loading up the extension php_sqlsrv_ts.dll. I have gone to the command line and try this:

C:\wamp\bin\php\php5.3.0>php.exe --re sqlsrv
Exception: Extension sqlsrv does not exist

C:\wamp\bin\php\php5.3.0>php.exe --re sqlsrv_ts
Exception: Extension sqlsrv_ts does not exist

In my PHP.ini - I have:

;extension=php_sqlsrv.dll
extension=php_sqlsrv_ts.dll

Thread safe is enabled for me hence the usage of php_sqlsrv_ts.dll. My extension_dir is correct because I load other modules from there. I also have Microsoft Native CLient 2008 too. Everytime I try to run my PHP script I get:

Fatal error: Call to undefined function sqlsrv_connect()

It must have something to do with the module not being loadaed up. I can get all extension info for MySQL but not for sqlsrv extension.

How can I get PHP to load this extension?

Thanks all

EDIT

Apache_Error_log:

PHP Warning:  PHP Startup: sqlsrv: Unable to initialize module\nModule compiled with module API=20060613\nPHP    compiled with module API=20090626\nThese options need to match\n in Unknown on line 0
PHP Warning:  Module 'xmlrpc' already loaded in Unknown on line 0
[Tue Oct 13 14:51:16 2009] [notice] Apache/2.2.11 (Win32) PHP/5.3.0 configured -- resuming normal operations
[Tue Oct 13 14:51:16 2009] [notice] Server built: Dec 10 2008 00:10:06
[Tue Oct 13 14:51:16 2009] [notice] Parent: Created child process 11916
PHP Warning:  PHP Startup: sqlsrv: Unable to initialize module\nModule compiled with module API=20060613\nPHP    compiled with module API=20090626\nThese options need to match\n in Unknown on line 0
<br />
<b>Warning</b>:  PHP Startup: sqlsrv: Unable to initialize module
Module compiled with module API=20060613
PHP    compiled with module API=20090626
These options need to match
 in <b>Unknown</b> on line <b>0</b><br />
PHP Warning:  Module 'xmlrpc' already loaded in Unknown on line 0
<br />
<b>Warning</b>:  Module 'xmlrpc' already loaded in <b>Unknown</b> on line <b>0</b><br />

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

江挽川 2024-08-14 09:10:08

那是版本不匹配。该模块是为比 mod_php 使用的 PHP 版本更早的 PHP 版本编译的。您将需要使用服务器上的版本来编译模块。

That is a version mismatch. The module was compiled for an earlier version of PHP than is used for mod_php. You will need to compile the module using the version on the server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文