如何将wamp主机连接到远程sql server

时间:2015-05-22 04:40:39

标签: php mysql dll sqlsrv

我已经在php C中上传了以下文件:\ wamp \ bin \ php \ php5.5.12 \ ext

  1. php_pdo_sqlsrv_55_nts.dll
  2. php_pdo_sqlsrv_55_ts.dll
  3. php_sqlsrv_55_ts.dll
  4. 我还在php.ini中启用了以下内容

    1. extension_dir =" c:/wamp/bin/php/php5.5.12/ext /"
    2. [PHP_SQLSRV] 延长= php_pdo_sqlsrv_55_ts.dll 延长= php_sqlsrv_55_ts.dll
    3. 但我仍然得到错误:

        

      致命错误:调用未定义的函数sqlsrv_connect()

      这是我的连接文件中的代码:

      $serverName = "xxx.xxx.xxx.x"; //serverName\instanceName
      $connectionInfo = array( "Database"=>"xxxxx", "UID"=>"xxx", "PWD"=>"xxx");
      $conn = sqlsrv_connect( $serverName, $connectionInfo);
      
      if( $conn ) 
      {
           echo "Connection established.<br />";
      }
      else{
           echo "Connection could not be established.<br />";
           die( print_r( sqlsrv_errors(), true));
      }
      

0 个答案:

没有答案