在为SQL Server 2008 Express加载PHP驱动程序时遇到问题

时间:2021-03-21 15:55:18

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

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

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:

我有一切设置但我认为我在加载扩展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

In my PHP.ini - I have:

在我的PHP.ini中 - 我有:

;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:

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

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.

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

How can I get PHP to load this extension?

如何让PHP加载此扩展?

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 />

1 个解决方案

#1


3  

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.

这是一个版本不匹配。该模块是为早期版本的PHP编译而不是用于mod_php。您需要使用服务器上的版本编译模块。

#1


3  

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.

这是一个版本不匹配。该模块是为早期版本的PHP编译而不是用于mod_php。您需要使用服务器上的版本编译模块。