0

I'm trying to connect to MSSQL 2008 from a (LAN) XP machine running IIS 5.1 & PHP 5.3.

I tried following this answer https://stackoverflow.com/a/5432118

Problems started when I had no snapshot.txt, however as I am running IIS and PHP as FastCGI extension I am fairly confident I need the non-threadsafe dll ?

Anyway, I downloaded SQLSRV30.EXE and extracted php_sqlsrv_53_nts.dll to my ext dir and added the extension to my php.ini. I also confirmed the extension_dir was correct & installed Microsoft SQL Server 2008 R2 Native Client before restarting IIS.

Unfortunately phpinfo() does not list sqlsrv as a loaded extension and I am now totally lost so any help would be highly appreciated.

Thanks

Community
  • 1
  • 1
JimmyJ
  • 4,311
  • 3
  • 27
  • 25
  • Did you remember to bounce any running `php-cgi.exe` processes in task manager (`IISRESET` should do this if you're on a non-production box). If you don't, FastCGI will pass requests to any already warmed up `php-cgi.exe` processes which won't have re-read your `php.ini` file after you make any changes. – Kev Jun 23 '12 at 00:38
  • Another thing to try is to run `php.exe -i` from the command line and have a look at the output (it'll output a text based version of `phpinfo()` without all the HTML markup). Would be helpful if you could do a `php.exe -i > info.txt` and paste this to a pastebin. – Kev Jun 23 '12 at 00:40
  • http://pastebin.com/E2sddmyS - thanks – JimmyJ Jun 25 '12 at 09:10

1 Answers1

0

Ok, so I eventually got the the bottom of it so I thought I'd report back and hopefully save some else a head ache....

In my php.ini I set display_startup_errors = On, restarted IIS and reloaded the page. At this point I got the magic nugget of information that for some reason was not being added to the log Fatal error: Unable to load Library........error: Access is denied.

So I navigated to the ext dir and selected the extension

Right Click > Properties > Security

And added permissions for Users & Power Users - restarted IIS and boom sqlsrv was loaded.

JimmyJ
  • 4,311
  • 3
  • 27
  • 25