dongying3830 2012-10-07 15:17
浏览 66

从PHP解决MSSQL连接问题

I'm trying to connect to an external Sql Server through PHP 5.2.

Using this line:

$con = mssql_connect('123.123.123.123','Username','Password') or die('Could not connect to the server!');

I'm receiving this error:

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: 123.123.123.123 in /home/file/public_html/structure/index.php on line 4 Could not connect to the server!

My hosting provider assures me that ports are open for my server to connect to the DB. Looking at my php info, MSSQL Support is enabled, using FreeTDS.

Any ideas why this would be failing, or how I can begin trouble shooting the problem?

  • 写回答

1条回答 默认 最新

  • duankeng9477 2013-01-23 02:21
    关注

    i know that there is some security for remote connection to MSSQL. i had a same issue. you need to give connection permition for requested ip.

    did you try to connect with your personal compter with a MS SQL program.

    if you can so you have problem with your cilent (php host)

    if you can not so you have problem with mssql server

    评论

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题