php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18360 Can't connect to database with an alias dns
Submitted: 2002-07-15 14:25 UTC Modified: 2002-08-01 11:45 UTC
From: vania at fe dot up dot pt Assigned:
Status: Not a bug Package: PEAR related
PHP Version: 4.2.0 OS: Win 2K
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
39 - 38 = ?
Subscribe to this entry?

 
 [2002-07-15 14:25 UTC] vania at fe dot up dot 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-16 06:46 UTC] 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-16 09:53 UTC] vania at fe dot up dot 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-17 01:52 UTC] cox@php.net
Do you get the same problem using the native PHP functions?
 [2002-08-01 11:45 UTC] cox@php.net
No feedback. Please reopen this bug if you feel that the problem is a PEAR DB bug.

Thanks,

Tomas V.V.Cox
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 07:01:27 2024 UTC