4

I've followed the answer to this question to the letter:

Connection between MSSQL and PHP 5.3.5 on IIS is not working

I'm using XAMPP with threadsafe 5.3. I've copied the files to the extension directory (while leaving them in the /php folder) and I've added the extension lines:

extension=php_sqlsrv_53_ts.dll
extension=php_pdo_sqlsrv_53_ts.dll

When I do this, Apache fails to start, giving me errors in eventvwr like:

Application popup: Warning : PHP Startup: Unable to load dynamic library
'C:\xampp\php\ext\php_sqlsrv_53_ts.dll' 
- The specified module could not be found.

Except, obviously, that that file DOES exist in that spot, and php.ini is pointed at that extension directory.

What's the problem?

Community
  • 1
  • 1
Michael B
  • 1,743
  • 4
  • 21
  • 35
  • unable to load also means unable to access. make sure that whatever UID php is running under has access rights on the file. – Marc B Jul 27 '12 at 20:16
  • Just checked. The relevant files have the same permissions as the other extensions in the directory. – Michael B Jul 27 '12 at 20:18
  • Was the library compiled using the same compiler? If you check phpinfo(); you should be able to see the compiler used for PHP. – williamvicary Jul 30 '12 at 20:13
  • I just downloaded the libraries from Microsoft. How would that make a difference? I can't compile them differently, right? – Michael B Jul 30 '12 at 20:37
  • Not that this helps necessarily, but i have the exact same problem with a different .dll: http://stackoverflow.com/questions/11693859/winxp-php-startup-unable-to-load-dynamic-library-php-ibm-db2-dll – adam Jul 30 '12 at 21:56
  • If you take out the two extension= lines, does apache then restart correctly? – adam Jul 30 '12 at 21:59
  • Yes - it restarts fine if I comment out the lines. – Michael B Jul 30 '12 at 23:59

6 Answers6

1

Windows reports this when a shared lib dependency of what you're loading is missing. Use depends.exe to view the dependencies of php_sqlsrv_53_ts.dll and make sure it's either previously loaded or in the shared library search path.

http://www.dependencywalker.com/

covener
  • 17,402
  • 2
  • 31
  • 45
  • FYI:: I ran this against my ext/php_ibm_db2 and it came up with about 50 dependencies. Almost none of those dependencies are in the /ext folder. This makes me wonder how accurate the tool is, or if i'm not understanding its use correctly. – adam Jul 31 '12 at 13:06
  • This didn't seem to help (crashed actually when I ran it against the relevant files), but thanks for answering. (#mtgpro4L, BTW) – Michael B Aug 06 '12 at 22:55
1

See below url

php_sqlsrv.dll: gives error when checking PHP version but extension works

Read it:-

Since PHP 5.3, Microsoft has a new driver for windows :

http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx

Maybe you can try this version, which seems quite recent (06/2011)

Hope that helps !

Community
  • 1
  • 1
Abid Hussain
  • 7,724
  • 3
  • 35
  • 53
1

Sadly, none of the answers addressed the issue or were avenues I had already explored.

I have decided to use the ODBC drivers with a SQL Server connection string, which seems to work fine, minus the fact I can't use MSSQL and SQLSRV native functions.

Michael B
  • 1,743
  • 4
  • 21
  • 35
1

I have written a page that might help when installing the SQLSRV driver: http://robsphp.blogspot.co.uk/2012/09/how-to-install-microsofts-sql-server.html

Unfortunately the instructions got complicated when MSFT removed the download for the old XP/2003 driver (version 2.0), so read the whole page before starting.

Rob
  • 191
  • 1
  • 5
0

Wrong technology, but I was having problems getting WAMP to connect to MSSQL, with the same types of errors.

I fixed the problem by installing the 32-bit version of WAMP (instead of 64, even though we were on a 64-bit system).

Even if that's not applicable to the OP, I hope someone finds this helpful!

Erty Seidohl
  • 4,487
  • 3
  • 33
  • 45
0

I was getting the same error messages when I started the Drupal 7 stack after installation. I am using VM Ware with Win 7 x64 and acquia-drupal-win-7.31.36-6159.54300.

I went to the PHP site http://php.net/manual/en/sqlsrv.requirements.php and installed the x64 Package. steps 1) Stop Drupal Stack 2) run the file: sqlncli.msi 3) restart Drupal, and no error messages.