0

Am using windows 8 pro, Wamp server (php V5.3.5, apache V2.2.17), Sql server 2005 express editon. I have downloaded the sqlsrv drivers and extracted them into the php extention folder (C:\wamp\bin\php\php5.3.5\ext), have also update the php.ini file by adding the extentions

extension=php_sqlsrv_53_ts_vc6.dll
extension=php_pdo_sqlsrv_53_ts_vc6.dll

I used this two after series of try and error on all the dll file, it was this two that come up with no error, when restarting the wamp server

This is the connection line of code;

$con = sqlsrv_connect('TAQUATECH\SQLEXPRESS') or die("cannot connect");

It came up with the following error;

Fatal error: Call to undefined function sqlsrv_connect() in C:\wamp\www\Webs\client.php on line 7

pls, i need somebody to help me on this, i will really appreciate

Shankar Narayana Damodaran
  • 68,075
  • 43
  • 96
  • 126
yommy
  • 1
  • 1
  • 1
  • 1

6 Answers6

1

Sorry if too late to answer, but I had the same error, and I found out that Wamp Server 64bit does not support SQL Server Connection, you must install a 32bit version of wamp server.

AliAwwad
  • 379
  • 3
  • 13
1

For those using 64-bit systems (OS, WAMP, MSSQL), these 64-bit drivers can serve them and fix the error:

Fatal error: Call to undefined function sqlsrv_connect() in C:\wamp\www...

Drivers SQLSRV x64:

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

SkyMaster
  • 1,323
  • 1
  • 8
  • 15
0

You'll need to install and enable sqlsrv on your web server. Have a look at the installation page on the official PHP website.

Wayne Whitty
  • 19,513
  • 7
  • 44
  • 66
  • Thanks have looked at the installation page, Under the requirement in Microsoft site, window 8 is not included, could that be the problem?, because am using window 8 os – yommy Aug 27 '13 at 08:20
0

Installation of Microsoft Drivers 3.0 for PHP for SQL Server will fix this issue. Also try this PHP Manual.

EDIT :

The most recent version of the driver is available for download here: » SQLSRV 3.0 download. If you need support for PHP 5.2 and/or PHP compiled with VC6, use the 2.0 release of the driver: » SQLSRV 2.0 download.

Source

Shankar Narayana Damodaran
  • 68,075
  • 43
  • 96
  • 126
  • thnks for your reply, but have done the installation before have even install the 2.0 version with it – yommy Aug 27 '13 at 07:52
  • You need 3.0 as you are using php 5.3.5 – Shankar Narayana Damodaran Aug 27 '13 at 08:06
  • I edited the php.ini to use the 3.0 dll file, when i restarted the wamp server, it displays a warning message PHP Startup: sqlsrv: Unable to initialize module Module compiled with build ID=API20090626,TS,VC9 PHP compiled with build ID=API20090626,TS,VC6 These options need to match – yommy Aug 27 '13 at 08:44
  • Please go through this link. Exactly the same problem what you are facing. http://stackoverflow.com/questions/12154738/php-starup-sqlsrv-unable-to-initialize-module – Shankar Narayana Damodaran Aug 27 '13 at 09:08
  • I used extension=php_sqlsrv_53_ts_vc6.dll extension=php_pdo_sqlsrv_53_ts_vc6.dll The server starts successfully but still cant identify the function "sqlsrv_connect()" - same undifined error message – yommy Aug 27 '13 at 13:28
  • am using windows 8, could that be the problem? – yommy Aug 27 '13 at 13:29
0

Yap, I have gotten a work-around;
The problem was, running the php script using apache server on my system, I stoped the wamp server and configure fastCGI for PHP using IIS 7, You can get a video tutorial Here

http://www.iis.net/learn/application-frameworks/running-php-applications-on-iis/set-up-fastcgi-for-php.

It simple and nice, now i can connect to both sql server 2005 and 2008

My PHP Details
Version => 5.3.5
Compiler => MSVC6 (Visual C++ 6.0)
SqlSrv Driver => php_sqlsrv_53_ts_vc6.dll

yommy
  • 1
  • 1
  • 1
  • 1
0
use 32 bit PHP Version.
enable below one of them in php.ini
[PHP_PDO_SQLSRV_53_NTS]
extension=php_pdo_sqlsrv_53_nts.dll
[PHP_SQLSRV_54_NTS]
extension=php_sqlsrv_54_nts.dll
[PHP_SQLSRV_53_NTS]
extension=php_sqlsrv_53_nts.dll
[PHP_PDO_SQLSRV_54_NTS]
extension=php_pdo_sqlsrv_54_nts.dll



thease dll version you can downlowd online
Khan
  • 151
  • 1
  • 4