Question

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 />
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top