dpjjr42626 2011-05-28 06:15
浏览 149
已采纳

php mssql_connect无法正常工作

Here's the code that I am using.

<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);

$myServer = "ip-address:1334/SQLEXPRESS";
$myUser = "username";
$myPass = "password";
$myDB = "dbname";

$link = mssql_connect($myServer, $myUser, $myPass);
if ( !$link ) {
  if ( function_exists('error_get_last') ) {
     var_dump(error_get_last());
           }
  die('connection failed');
   }
  ?>

Now this code is running on a linux machine and the server is on a windows server. The IP is correct as well as username, password I created a new pair inside SQLEXPRESS. However, I still get a connection issue.

 Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server

the port 1334 is opened by our windows server and SQL server is listening to both 1334 and 1433. THey wont open default port for security reasons. They have double checked the settings but I still cannot connect.

What should be the next action for me.

Kind regards

Khuram

  • 写回答

3条回答 默认 最新

  • donglan9517 2011-05-28 06:26
    关注

    May be the windows SQL server have a firewall restriction which is restricting to access from outside of the server.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?