douhu2525
2013-10-01 18:18 阅读 23
已采纳

PHP SQL Server访问被拒绝(严重性9)[重复]

This question already has an answer here:

I have an old website that I am moving from an old server to a newer server. I have set up php and verified that it works and I have installed Microsoft SQL Server and migrated the old db and users. I am running php-5.2.13 and windows server 2008 r2

I am having problems connecting to SQL.

<?php
mssql_connect('localhost', 'GeoTracker1', 'GeoTracker1');
?>

Gives me:

( ! ) Warning: mssql_connect() [function.mssql-connect]: Unable to connect: SQL Server is unavailable or does not exist. Access denied. (severity 9) in C:\inetpub\wwwroot\geotracker\mssqlcheck.php on line 2

Call Stack

#

Time

Memory

Function

Location

1 0.0002 102608 {main}( ) ..\mssqlcheck.php:0 2 0.0002 102808 mssql_connect ( ) ..\mssqlcheck.php:2

( ! ) Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: localhost in C:\inetpub\wwwroot\geotracker\mssqlcheck.php on line 2

Call Stack

#

Time

Memory

Function

Location

1 0.0002 102608 {main}( ) ..\mssqlcheck.php:0 2 0.0002 102808 mssql_connect ( ) ..\mssqlcheck.php:2

</div>
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    download92000 download92000 2013-10-01 19:14

    Enable Named Pipes on your new SQL Server.

    点赞 评论 复制链接分享

相关推荐