Doc #63312 [Nab]: Missing documentation
| From: | raul dot 3k at gmail dot com | Date: | Sat, 12 Jan 2013 15:20:58 +0000 |
| Subject: | Doc #63312 [Nab]: Missing documentation | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-9395@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63312&edit=1
ID: 63312
User updated by: raul dot 3k at gmail dot com
Reported by: raul dot 3k at gmail dot com
Summary: Missing documentation
Status: Not a bug
Type: Documentation Problem
Package: MSSQL related
Operating System: Windows
PHP Version: 5.3.18
Block user comment: N
Private report: N
New Comment:
I don't know how I can demonstrate it to you. But I just tested it again and I
got the same error:
<?php
$serverName = "192.168.0.11";
$connectionInfo = array( "Database"=>"CorporeRM",
"UID"=>"planilha",
"PWD"=>"planilha");
$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));
}
?>
Result:
Connection established.
With the serverName:
<?php
$serverName = "192.168.0.11\SVDCBD01";
$connectionInfo = array( "Database"=>"CorporeRM",
"UID"=>"planilha",
"PWD"=>"planilha");
$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));
}
?>
Result:
Connection could not be established.
Array
(
[0] => Array
(
[0] => 08001
[SQLSTATE] => 08001
[1] => -1
[code] => -1
[2] => [Microsoft][SQL Server Native Client 10.0]SQL Server Network
Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
[message] => [Microsoft][SQL Server Native Client 10.0]SQL Server
Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
)
[1] => Array
(
[0] => HYT00
[SQLSTATE] => HYT00
[1] => 0
[code] => 0
[2] => [Microsoft][SQL Server Native Client 10.0]Login timeout
expired
[message] => [Microsoft][SQL Server Native Client 10.0]Login timeout
expired
)
[2] => Array
(
[0] => 08001
[SQLSTATE] => 08001
[1] => -1
[code] => -1
[2] => [Microsoft][SQL Server Native Client 10.0]A network-related
or instance-specific error has occurred while establishing a connection to SQL
Server. Server is not found or not accessible. Check if instance name is correct
and if SQL Server is configured to allow remote connections. For more
information see SQL Server Books Online.
[message] => [Microsoft][SQL Server Native Client 10.0]A network-
related or instance-specific error has occurred while establishing a connection
to SQL Server. Server is not found or not accessible. Check if instance name is
correct and if SQL Server is configured to allow remote connections. For more
information see SQL Server Books Online.
)
I also took a screenshot of the server configuration and hosted on ImagesHack:
http://img829.imageshack.us/img829/5719/doct.jpg
Previous Comments:
------------------------------------------------------------------------
[2013-01-12 05:09:36] frozenfire@php.net
So far as I can tell, this is an issue with your connection parameters, as
opposed to incorrect documentation.
If you can demonstrate that a modification of your $serverName parameter with the
same essential information results in a successful connection, such that the
documentation is incorrect, please do so.
------------------------------------------------------------------------
[2012-10-19 13:47:13] raul dot 3k at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.sqlsrv-connect
---
I noticed that you don't really need to put the instance name in connection
string.
In my case (SQL Server 2008 R2 on Windows Server 2008 as database server, using a
php 5.3.14 and Windows Server 2003 with IIS 6.0 as web server), this function
don't let me put the instance name at string connection. It throws an error: Error
Locating Server/Instance Specified.
Test script:
---------------
<?php
// When I take the instance name off, it works.
$serverName = "192.168.0.11\SVDCBD01";
$connectionInfo = array( "Database"=>"CorporeRM",
"UID"=>"planilha", "PWD"=>"planilha");
$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));
}
?>
Expected result:
----------------
Connection established.
Actual result:
--------------
Array
(
[0] => Array
(
[0] => 08001
[SQLSTATE] => 08001
[1] => -1
[code] => -1
[2] => [Microsoft][SQL Server Native Client 10.0]SQL Server Network
Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
[message] => [Microsoft][SQL Server Native Client 10.0]SQL Server
Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
)
[1] => Array
(
[0] => HYT00
[SQLSTATE] => HYT00
[1] => 0
[code] => 0
[2] => [Microsoft][SQL Server Native Client 10.0]Login timeout
expired
[message] => [Microsoft][SQL Server Native Client 10.0]Login timeout
expired
)
[2] => Array
(
[0] => 08001
[SQLSTATE] => 08001
[1] => -1
[code] => -1
[2] => [Microsoft][SQL Server Native Client 10.0]A network-related
or instance-specific error has occurred while establishing a connection to SQL
Server. Server is not found or not accessible. Check if instance name is correct
and if SQL Server is configured to allow remote connections. For more
information see SQL Server Books Online.
[message] => [Microsoft][SQL Server Native Client 10.0]A network-
related or instance-specific error has occurred while establishing a connection
to SQL Server. Server is not found or not accessible. Check if instance name is
correct and if SQL Server is configured to allow remote connections. For more
information see SQL Server Books Online.
)
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63312&edit=1