0

I am working on learning PHP, and one of my goals is to be able to connect to an SQL Server database. I am on a virtual Windows 2008 Server and have 32-bit PHP 5.6.0 installed. I have downloaded the sqlsrv drivers and put them into C:\PHP\ext. The drivers in there are php_sqlsrv_54_ts.dll and php_sqlsrv.dll.

I restarted the web server (and the VM too), and phpinfo still doesn't list the sqlsrv section. I can't seem to figure out what I am missing.

I have looked at issues with 64-bit vs 32-bit, but I don't understand all of it. If anyone has any thoughts or can help me to troubleshoot this, I would love to get past configuration and start building PHP pages!

Thanks!

4
  • Did you add the requisite entries into php.ini?
    – JuxVP
    Jun 4, 2015 at 14:56
  • yep. I checked my builds and all. These are the dynamic extensions: extension=php_wincache.dll extension=php_pgsql.dll extension=php_pdo_odbc.dll extension=php_sqlsrv_56_ts.dll extension=php_pdo_sqlsrv_56_ts.dll Jun 4, 2015 at 15:10
  • I also have extension_dir = "C:\PHP\ext" and I have verified that all dlls are in that directory. Jun 4, 2015 at 15:11
  • When I run php.exe I get this: PHP Warning: PHP Startup: wincache: Unable to initialize module Module compiled with build ID=API20131226,NTS,VC11 PHP compiled with build ID=API20131226,TS,VC11 These options need to match in Unknown on line 0 PHP_MINIT_FUNCTION for php_sqlsrv: entering PHP_RINIT for php_sqlsrv: entering sqlsrv.WarningsReturnAsErrors = On sqlsrv.LogSeverity = -1 sqlsrv.LogSubsystems = -1 sqlsrv.ClientBufferMaxKBSize = 10240 Jun 4, 2015 at 15:11

1 Answer 1

0

It is a module incompatibility. Your PHP is the Thread-Safe version, and the wincache module requires the Non-Thread-Safe version.

You must either remove the wincache extension, or install the non-thread-safe version of PHP.

3
  • Thanks. Now I just see this when I run the php.exe : PHP_MINIT_FUNCTION for php_sqlsrv: entering PHP_RINIT for php_sqlsrv: entering sqlsrv.WarningsReturnAsErrors = On sqlsrv.LogSeverity = -1 sqlsrv.LogSubsystems = -1 sqlsrv.ClientBufferMaxKBSize = 10240 I still don't see any sqlsrv section in the phpinfo() I restart web services, but nothing. Jun 4, 2015 at 19:58
  • What does phpinfo() output? Also, what does php -v output?
    – JuxVP
    Jun 4, 2015 at 20:58
  • I commented out the wincache, and when I start php.exe console, I see what I put in the above comment. when I type php -v and hit enter, nothing happens. Same when I type phpinfo() . It sounds like I need to clean up the vm and uninstall stuff, so I can install compatible components, etc. What I am unsure of is the reason or purpose of choosing ts or nts. It sounds like I should uninstall ts php and install nts, but non-thread safe sounds like a bad way to run processes, unless I am missing something. Thanks for all your comments! Jun 5, 2015 at 15:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .