Results 1 to 9 of 9

Thread: PHP and SQL Server on IIS

  1. #1
    www.dougmcdonald.co.uk
    Join Date
    May 2007
    Location
    Bath
    Posts
    523
    Thanks
    5
    Thanked
    20 times in 20 posts
    • DougMcDonald's system
      • Motherboard:
      • Asus P5B Deluxe
      • CPU:
      • Inter Core 2 Duo E6600
      • Memory:
      • 2 x 2GB - Geil Black Dragon PC6400
      • Storage:
      • 2 x 400GB Samsung Spinpoints (Running in Matrix array) 100GB @ RAID0 + 300GB @ RAID1
      • Graphics card(s):
      • BFG nVidia 8800GTS 320MB OC2
      • PSU:
      • Corsair HX520W modular
      • Case:
      • Lian-Li PC7 II Plus
      • Monitor(s):
      • LG 17" Flat Thingy
      • Internet:
      • Crappy BT 1MB Unreliable wank :s

    PHP and SQL Server on IIS

    Hi There,

    I have recently installed PHP on an IIS server and this worked fine, I can get my php info etc to work with no problems but can't seem to connect to SQL server.

    I am confident that the user I am using has appropriate permissions, and I seem to be able to to physically connect to the server but I'm getting chucked out based on username/password.

    It is a domain based system and I am using "domain\username" for the username field. I wonder if this is the right syntax or not.

    Has anyone else had any experience with this kind of thing? And pointers? I'm fairly sure it's either something totally fundamental or something really small that I'm missing.

    Any help greatly appreciated

  2. #2
    Gentoo Ricer
    Join Date
    Jan 2005
    Location
    Galway
    Posts
    11,048
    Thanks
    1,016
    Thanked
    944 times in 704 posts
    • aidanjt's system
      • Motherboard:
      • Asus Strix Z370-G
      • CPU:
      • Intel i7-8700K
      • Memory:
      • 2x8GB Corsiar LPX 3000C15
      • Storage:
      • 500GB Samsung 960 EVO
      • Graphics card(s):
      • EVGA GTX 970 SC ACX 2.0
      • PSU:
      • EVGA G3 750W
      • Case:
      • Fractal Design Define C Mini
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • Asus MG279Q
      • Internet:
      • 240mbps Virgin Cable
    Which SQL server, and have you tried authenticating the user/passwd with a standalone client?

    Also try using some sample code to dig out errors that's happening along the way.
    Quote Originally Posted by Agent View Post
    ...every time Creative bring out a new card range their advertising makes it sound like they have discovered a way to insert a thousand Chuck Norris super dwarfs in your ears...

  3. #3
    Splash
    Guest
    Which SQL server are you using? When you installed SQL Server did you have to specify a sa password, and if so can you connect using this?

    EDIT - dammit, beaten to the punch by aidanjt...

  4. #4
    www.dougmcdonald.co.uk
    Join Date
    May 2007
    Location
    Bath
    Posts
    523
    Thanks
    5
    Thanked
    20 times in 20 posts
    • DougMcDonald's system
      • Motherboard:
      • Asus P5B Deluxe
      • CPU:
      • Inter Core 2 Duo E6600
      • Memory:
      • 2 x 2GB - Geil Black Dragon PC6400
      • Storage:
      • 2 x 400GB Samsung Spinpoints (Running in Matrix array) 100GB @ RAID0 + 300GB @ RAID1
      • Graphics card(s):
      • BFG nVidia 8800GTS 320MB OC2
      • PSU:
      • Corsair HX520W modular
      • Case:
      • Lian-Li PC7 II Plus
      • Monitor(s):
      • LG 17" Flat Thingy
      • Internet:
      • Crappy BT 1MB Unreliable wank :s
    I'm using SQL server 2005. And don't have any issues with the user outside of PHP.

    I have tried changing the username/password combo to my own windows uname/password as this would have sa rights and we tend to use windows authentication on our sql servers here so this should work...in theory!

  5. #5
    Gentoo Ricer
    Join Date
    Jan 2005
    Location
    Galway
    Posts
    11,048
    Thanks
    1,016
    Thanked
    944 times in 704 posts
    • aidanjt's system
      • Motherboard:
      • Asus Strix Z370-G
      • CPU:
      • Intel i7-8700K
      • Memory:
      • 2x8GB Corsiar LPX 3000C15
      • Storage:
      • 500GB Samsung 960 EVO
      • Graphics card(s):
      • EVGA GTX 970 SC ACX 2.0
      • PSU:
      • EVGA G3 750W
      • Case:
      • Fractal Design Define C Mini
      • Operating System:
      • Windows 10 Pro
      • Monitor(s):
      • Asus MG279Q
      • Internet:
      • 240mbps Virgin Cable
    According to the dev manual, you need to copy a library to use the MS SQL functions (or install the client on the php box). Have you done so?
    Quote Originally Posted by Agent View Post
    ...every time Creative bring out a new card range their advertising makes it sound like they have discovered a way to insert a thousand Chuck Norris super dwarfs in your ears...

  6. #6
    www.dougmcdonald.co.uk
    Join Date
    May 2007
    Location
    Bath
    Posts
    523
    Thanks
    5
    Thanked
    20 times in 20 posts
    • DougMcDonald's system
      • Motherboard:
      • Asus P5B Deluxe
      • CPU:
      • Inter Core 2 Duo E6600
      • Memory:
      • 2 x 2GB - Geil Black Dragon PC6400
      • Storage:
      • 2 x 400GB Samsung Spinpoints (Running in Matrix array) 100GB @ RAID0 + 300GB @ RAID1
      • Graphics card(s):
      • BFG nVidia 8800GTS 320MB OC2
      • PSU:
      • Corsair HX520W modular
      • Case:
      • Lian-Li PC7 II Plus
      • Monitor(s):
      • LG 17" Flat Thingy
      • Internet:
      • Crappy BT 1MB Unreliable wank :s
    I have yeah, got the ntwd..whateveritscalled.dll in place and calling the functions does not seem to be the issue.

    The functions are recognised, but the errors appears with authentication.

    I cannot connect to the database because: PHP Warning: mssql_connect() [function.mssql-connect]: message: Login failed for user 'nmr1\phptest'. (severity 14) in D:\Web Sites\HAMSTA\dbtest.php on line 2

  7. #7
    www.dougmcdonald.co.uk
    Join Date
    May 2007
    Location
    Bath
    Posts
    523
    Thanks
    5
    Thanked
    20 times in 20 posts
    • DougMcDonald's system
      • Motherboard:
      • Asus P5B Deluxe
      • CPU:
      • Inter Core 2 Duo E6600
      • Memory:
      • 2 x 2GB - Geil Black Dragon PC6400
      • Storage:
      • 2 x 400GB Samsung Spinpoints (Running in Matrix array) 100GB @ RAID0 + 300GB @ RAID1
      • Graphics card(s):
      • BFG nVidia 8800GTS 320MB OC2
      • PSU:
      • Corsair HX520W modular
      • Case:
      • Lian-Li PC7 II Plus
      • Monitor(s):
      • LG 17" Flat Thingy
      • Internet:
      • Crappy BT 1MB Unreliable wank :s
    Ah ok, scratch that.

    Have just managed to fix it.

    Seems the problem was with 'mssql.secure_connection = Off' in the php ini.

    Some people had suggested turn off to sort things out. Turns out it needs to be one.

    That will teach me to read the ini description properly :S

    "; Use NT authentication when connecting to the server"

  8. #8
    Splash
    Guest
    Quote Originally Posted by DougMcDonald View Post
    I'm using SQL server 2005. And don't have any issues with the user outside of PHP.

    I have tried changing the username/password combo to my own windows uname/password as this would have sa rights and we tend to use windows authentication on our sql servers here so this should work...in theory!
    Does it work with the SQL server sa account though? You do know theory and practice are two widely different (and occasionally diamtrically opposite) poles, right?

    EDIT - d'oh!

  9. #9
    www.dougmcdonald.co.uk
    Join Date
    May 2007
    Location
    Bath
    Posts
    523
    Thanks
    5
    Thanked
    20 times in 20 posts
    • DougMcDonald's system
      • Motherboard:
      • Asus P5B Deluxe
      • CPU:
      • Inter Core 2 Duo E6600
      • Memory:
      • 2 x 2GB - Geil Black Dragon PC6400
      • Storage:
      • 2 x 400GB Samsung Spinpoints (Running in Matrix array) 100GB @ RAID0 + 300GB @ RAID1
      • Graphics card(s):
      • BFG nVidia 8800GTS 320MB OC2
      • PSU:
      • Corsair HX520W modular
      • Case:
      • Lian-Li PC7 II Plus
      • Monitor(s):
      • LG 17" Flat Thingy
      • Internet:
      • Crappy BT 1MB Unreliable wank :s
    Looks like I had just disabled NT based authentication mode for the sql server access.

    If it was trying to use sql server level access, this would explain why the login was failing. As I say, we use NT authentication on our sql servers

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Batch upload + my sql update.
    By liquid-fix in forum Software
    Replies: 5
    Last Post: 02-05-2007, 09:54 AM
  2. Database Visualisation Tool ? Developing in SQL
    By Sinizter in forum Software
    Replies: 5
    Last Post: 29-04-2007, 12:20 PM
  3. Replies: 8
    Last Post: 02-03-2006, 04:31 PM
  4. Member Database SQL / PHP
    By realm in forum Software
    Replies: 4
    Last Post: 03-01-2006, 06:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •