Call to undefined function mssql_connect()

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Call to undefined function mssql_connect()

Postby bazianm » 30. May 2013 14:52

Hi,

I am trying to get XAMPP 1.8.1 to work with SQL Server 2012. I can't seem to get it to to work.

I have googled the problem and based on that I did the following:

(My XAMPP is installed in f:\xampp)

I edited f:\xampp\php\php.ini and uncommented:
extension=php_mssql.dll

I copied the file ntwdblib.dll (File version 2000.2.8.0) to the following folders:
f:\xampp\apache\bin
f:\xampp\php

I downloaded php_mssql.dll and put it in f:\xampp\php\ext

I restarted the Apache service.

I still get an error:

Fatal error: Call to undefined function mssql_connect() in F:\xampp\htdocs\mydomain\functions.php on line 14

I checked my phpinfo. There is no MSSQL section. MSSQL is only mentioned under COnfigure Command:

cscript /nologo configure.js "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=C:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=C:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=C:\php-sdk\oracle\instantclient11\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--disable-static-analyze" "--with-pgo"

I checked and the loaded configuration file is the one I edited.

Any assistance would be greatly appreciated.
bazianm
 
Posts: 10
Joined: 19. October 2006 22:40

Re: Call to undefined function mssql_connect()

Postby hackattack142 » 30. May 2013 22:17

Hello,

You will most likely need to use the SQLSRV extension rather than the MSSQL one (they are both for MS SQL Server but MSSQL extension was discontinued some time ago and removed from PHP 5.3 and onward http://us2.php.net/manual/en/intro.mssql.php)

See here: http://www.php.net/manual/en/sqlsrv.requirements.php

1. You will need to grab the Microsoft SQL Server 2012 Native Client x86 install and the SQLSRV 3.0 install from the sqlsrv link above.
2. Extract the SQLSRV to somewhere convenient and copy the "php_sqlsrv_54_ts.dll" and "php_pdo_sqlsrv_54_ts.dll" files to your xampp/php/ext folder
3. Add the proper extension lines to your php.ini "extension=php_sqlsrv_54_ts.dll" and "extension=php_pdo_sqlsrv_54_ts.dll"
4. Restart apache and you should be good to go.

Note: if you have existing code that uses the mssql functions, you will need to port it to the sqlsrv ones.
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 701
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit

Re: Call to undefined function mssql_connect()

Postby bazianm » 30. May 2013 22:27

Thanks. I will try that.
bazianm
 
Posts: 10
Joined: 19. October 2006 22:40

Re: Call to undefined function mssql_connect()

Postby pio_sk » 12. June 2013 07:28

Hi
I got similar problem.
Cant connect to MSsql server 2008 R2.
I added extension php_sqlsrv_54_ts.dll to my php and restarted server but now I got error :
"-49 [2] => This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: ""

i tried to install that odbc driver but it is not supported for windows XP.
any clues how can I resolve this ?
pio_sk
 
Posts: 1
Joined: 12. June 2013 07:20
Operating System: Windows XP

Re: Call to undefined function mssql_connect()

Postby Nobbie » 12. June 2013 11:27

pio_sk wrote:i tried to install that odbc driver but it is not supported for windows XP.
any clues how can I resolve this ?


You should ask Microsoft.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Call to undefined function mssql_connect()

Postby hackattack142 » 12. June 2013 23:21

XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 701
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 125 guests