PHP can't find sqlsrv_connect()

Category: sql server driverphp

Question

miltlonkbenjamin on Thu, 21 Aug 2014 15:03:42


Windows 7 Home Premium Service Pack 1 Pentium Dual Core CPU PHP is installed in "c:\programfiles (x86)\php"

I am trying to connect to sql server 2013 from the following php release on a Windows 7 Machine:

c:\Milt_C\zend>php --version
PHP 5.5.15 (cli) (built: Jul 23 2014 15:05:09)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

my php.ini file snippet is:

extension_dir="C:\Program Files (x86)\php\ext"
extension=php_pdo_sqlsrv.dll; non-thread safe  ; MKB
;extension=php_pdo_sqlsrv_53_nts.dll
extension=php_sqlsrv_53_nts.dll
[sqlsrv]
sqlsrv.LogSubsystems=-1
sqlsrv.LogSeverity=-1
sqlsrv.WarningReturnAsErrors=0

I installed the following files in my .ext directory usig SQLSRV30.EXE:

php_pdo_sqlsrv_53_ts.dll  php_pdo_sqlsrv_53_nts.dll   php_pdo_sqlsrv_54_ts.dll     php_pdo_sqlsrv_54_nts.dll

php_sqlsrv_53_ts.dll  php_sqlsrv_53_nts.dll   php_sqlsrv_54_ts.dll     php_sqlsrv_54_nts.dll

The error message is "Call to undefined function sqlsrv_connect().

Any ideas will be appreciated

Best,

Milt

miltonkbenjamin@verizon.net


miltonkbenjamin

Replies

BuckyRocks on Fri, 12 Sep 2014 16:01:39


If you're running PHP 5.5 you need:

extension=php_pdo_sqlsrv_55_ts.dll
extension=php_sqlsrv_55_ts.dll

I don't think MS has 'official' versions for 5.5. Info here:

http://testamentate16.rssing.com/chan-9363525/latest.php

You can try drivers from:

http://robsphp.blogspot.co.uk/2012/06/unofficial-microsoft-sql-server-driver.html


gintal on Mon, 15 Sep 2014 12:34:42


There are no official drivers for PHP 5.5 or 5.6 at this time.  The only items that exist are unofficial builds from community members.  We've been "promised" by MS that a PHP driver is in the works for over a year now but that's starting to feel more like a lie than a promise now.

https://connect.microsoft.com/SQLServer/feedback/details/790641/sql-server-driver-for-php-5-5#details