Jump to content


Photo

Connecting to MS SQL


  • Please log in to reply
3 replies to this topic

#1 urisk23

urisk23

    Newbie

  • New Members
  • Pip
  • 2 posts

Posted 11 January 2013 - 03:34 PM

I am pretty new to php, and I feel like I am missing something pretty fundamental. I am trying to connect to SQL Server.

A little background: I have a wamp server that I am using personally for my own web applications. At work we use SQL Server, and my Boss wants me to explore adding a bit of web functionality to our applications. We use SQL Server at work.

I thought it would be less disruptive to the our work environment if I start by using my personal wamp server on my workstation.

So I downloaded SQLSRV30.EXE and installed the files in C:\wamp\bin\php\php5.3.10\ext.

I have added the following line to the C:\wamp\bin\php\php5.3.10\php.ini file in the Extensions section:
extension=php_sqlsrv_53_ts.dll

and restarted the server.

I have seen other web sites that tell me I should see sqlsvr in the Registered PHP Streams (in the phpinfo page). I do not. And of course the sqlsvr calls don't work.

I receive errors like: Fatal error: Call to undefined function sqlsrv_connect()

Here is at least one piece I really don't understand. In my phpinfo page the "Loaded Configuration File " reads, "C:\wamp\bin\apache\Apache2.2.21\bin\php.ini" However, this doesn't seem to be the case. I have renamed that file, and I have modified that file in various ways, and it seems to have no affect. However, when I modify the C:\wamp\bin\php\php5.3.10\php.ini, and restart the server, it clearly does have affect. For instance, I tried the nts version and when I restarted the server, it failed pretty dramatically.

jic, I put the extension line in both php.ini files.

Anyway, I feel like I am missing something pretty fundamental. Any help would be appreciated.

#2 kicken

kicken

    Wiser? Not exactly.

  • Gurus
  • 1,666 posts
  • LocationBonita, FL

Posted 11 January 2013 - 06:59 PM

Did you install the Microsoft SQL Server 2012 Native Client?  You need that for the driver to work properly.  You can download it from http://www.microsoft...s.aspx?id=29065
Recycle your old CD's, don't trash them!
Did I help you out?  Feeling generous? I accept tips via Paypal or Bitcoin @ 14mDxaob8Jgdg52scDbvf3uaeR61tB2yC7

#3 urisk23

urisk23

    Newbie

  • New Members
  • Pip
  • 2 posts

Posted 28 January 2013 - 02:42 PM

Sorry I didn't reply earlier. Yes. I installed the Native Client. No luck.

#4 budimir

budimir

    Advanced Member

  • Members
  • PipPipPip
  • 442 posts
  • LocationCroatia

Posted 05 May 2013 - 03:42 AM

Did you mange to fix you're problem?

 

You should try with this:

 

extension=php_sqlsrv_53_ts_vc9.dll


I'm learning..... Still don't know nothing!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com