Bug #18360 Updated: Can't connect to database with an alias dns
| From: | cox@php.net | Date: | Wed, 17 Jul 2002 05:52:16 +0000 |
| Subject: | Bug #18360 Updated: Can't connect to database with an alias dns | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7752@lists.php.net to get a copy of this message | ||
ID: 18360
Updated by: cox@php.net
Reported By: vania@fe.up.pt
-Status: Bogus
+Status: Feedback
Bug Type: PEAR related
Operating System: Win 2K
PHP Version: 4.2.0
New Comment:
Do you get the same problem using the native PHP functions?
Previous Comments:
------------------------------------------------------------------------
[2002-07-16 09:53:29] vania@fe.up.pt
I used the bug system, because I hadn't any problems using PEAR DB with
the real dns to the database server.
Here is the output of print_r(DB::connect($dsn)):
With the real dns to the database server, I get:
db_mssql Object ( [connection] => Resource id #1 [phptype] => mssql
[dbsyntax] => mssql [prepare_tokens] => Array ( ) [prepare_types] =>
Array ( ) [transaction_opcount] => 0 [autocommit] => 1 [_db] =>
<DATABASE_NAME> [_debug] => [_default_error_mode] =>
[_default_error_options] => [_default_error_handler] => [_error_class]
=> DB_Error [_expected_errors] => Array ( ) [features] => Array (
[prepare] => [pconnect] => 1 [transactions] => 1 [limit] => emulate )
[errorcode_map] => Array ( ) [type] => [prepared_queries] =>
[prepare_maxstmt] => 0 [last_query] => [fetchmode] => 1
[fetchmode_object_class] => stdClass [options] => Array ( [persistent]
=> [optimize] => performance [debug] => 0 [seqname_format] => %s_seq )
[dbh] => [dsn] => Array ( [phptype] => mssql [dbsyntax] => mssql
[username] => <USERNAME> [password] => [protocol] => tcp [hostspec] =>
<HOST> [port] => [socket] => [database] => <DATABASE_NAME> ) )
(I replaced username, host, database with <USERNAME>, <HOST>,
<DATABSE_NAME>)
With the alias to the dns I get this output:
db_error Object ( [error_message_prefix] => [mode] => 1 [level] => 1024
[code] => -24 [message] => DB Error: connect failed [userinfo] => <DSN>
[callback] => ) DB Error: connect failed
I guess it's not a problem with how to use PEAR DB because now I have a
stable system using PEAR DB for a few months.
Thanks.
Vânia
------------------------------------------------------------------------
[2002-07-16 06:46:37] cox@php.net
For getting support about how to use PEAR libraries please go to
http://pear.php.net/support.php. Btw you could try to
read the output
of:
<?php
require_once 'DB.php';
$dsn="xxx";
print_r(DB::connect($dsn));
?>
As I said, until you don't provide specific data on where something
fails or how to reproduce the problem, please do not use the bug
system.
Tomas V.V.Cox
------------------------------------------------------------------------
[2002-07-15 14:25:04] vania@fe.up.pt
I'm using PHP 4.2.0 with PEAR and IIS.
Using PEAR DB I can't connect to a MSSQL database using an alias dns
for the host param in $dsn.
From that machine if I make a ping to that alias I get a reply, so I
think it's not a network problem.
With a similar script in ASP it easily connects to database with this
alias, so it might be a PEAR bug.
Thanks.
Vânia
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18360&edit=1