Problem With Pear::DB
am 09.05.2007 16:59:48 von Jody Williams
I have a situation where I am unable to connect to a Microsoft SQL
2005 Database from Windows Server 2003 (IIS + PHP 5.0.4).
here is the code:
require_once 'DB.php';
$dsn = "mssql://aspj_transfer:XXXXXX@eggrs006/transfer_station";
$db = DB::connect($dsn);
if (DB::isError($db))
{
die ($db->getMessage().'
'.$db->getUserInfo());
}
// no useful info. just trying to return something.
$query = "select [name] as n from sysobjects order by [name]";
$data =& $db->query($query);
while ($row = $data->fetchRow())
{
echo $row[0]."
";
}
$db->disconnect();
?>
Here is the error:
[DB Error: connect failed] **
mssql://aspj_transfer:XXXXXX@eggrs006/transfer_station
From my workstation, this can connect just fine (Windows XP, IIS, PHP 5.0.4).
There aren't any firewalls between the machines.
Any suggestions?
Jody
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Problem With Pear::DB
am 09.05.2007 17:04:56 von Stut
Jody Williams wrote:
> I have a situation where I am unable to connect to a Microsoft SQL
> 2005 Database from Windows Server 2003 (IIS + PHP 5.0.4).
>
> here is the code:
>
> require_once 'DB.php';
> $dsn = "mssql://aspj_transfer:XXXXXX@eggrs006/transfer_station";
> $db = DB::connect($dsn);
> if (DB::isError($db))
> {
> die ($db->getMessage().'
'.$db->getUserInfo());
> }
> // no useful info. just trying to return something.
> $query = "select [name] as n from sysobjects order by [name]";
> $data =& $db->query($query);
> while ($row = $data->fetchRow())
> {
> echo $row[0]."
";
> }
> $db->disconnect();
> ?>
>
> Here is the error:
>
> [DB Error: connect failed] **
> mssql://aspj_transfer:XXXXXX@eggrs006/transfer_station
>
> From my workstation, this can connect just fine (Windows XP, IIS, PHP
> 5.0.4).
>
> There aren't any firewalls between the machines.
>
> Any suggestions?
Can the server you're running this on resolve eggrs006 to an IP address?
If not, that's your problem. If it can then you need to check the SQL
server user to make sure it can access that database from that machine.
Note that it is very very very unlikely that this problem is anything to
do with PHP or Pear::DB.
-Stut
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Problem With Pear::DB
am 09.05.2007 17:36:49 von Jody Williams
THat is what I thought. Just to confirm, I created an ODBC connection
for the Windows 2k3 server to the Database using the Server name. I
tried the IP in the PHP file and have the same results.
Is there some kind of restriction that might be in place in Windows 2003?
Jody
On 5/9/07, Stut wrote:
> Jody Williams wrote:
> > I have a situation where I am unable to connect to a Microsoft SQL
> > 2005 Database from Windows Server 2003 (IIS + PHP 5.0.4).
> >
> > here is the code:
> >
> > require_once 'DB.php';
> > $dsn = "mssql://aspj_transfer:XXXXXX@eggrs006/transfer_station";
> > $db = DB::connect($dsn);
> > if (DB::isError($db))
> > {
> > die ($db->getMessage().'
'.$db->getUserInfo());
> > }
> > // no useful info. just trying to return something.
> > $query = "select [name] as n from sysobjects order by [name]";
> > $data =& $db->query($query);
> > while ($row = $data->fetchRow())
> > {
> > echo $row[0]."
";
> > }
> > $db->disconnect();
> > ?>
> >
> > Here is the error:
> >
> > [DB Error: connect failed] **
> > mssql://aspj_transfer:XXXXXX@eggrs006/transfer_station
> >
> > From my workstation, this can connect just fine (Windows XP, IIS, PHP
> > 5.0.4).
> >
> > There aren't any firewalls between the machines.
> >
> > Any suggestions?
>
> Can the server you're running this on resolve eggrs006 to an IP address?
> If not, that's your problem. If it can then you need to check the SQL
> server user to make sure it can access that database from that machine.
>
> Note that it is very very very unlikely that this problem is anything to
> do with PHP or Pear::DB.
>
> -Stut
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Problem With Pear::DB
am 09.05.2007 19:43:40 von Jody Williams
Any idea why this does work from the same server?
require_once './includes/adodb/adodb.inc.php';
$dsn = "Provider=MSDASQL;Driver={SQL
Server};SERVER=eggrs006;DATABASE=transfer_station;UID=aspj_t ransfer;PWD=XXXXXX;";
$db = &ADONewConnection("ado_mssql");
$db->Connect($dsn);
$rs = $db->Execute("select [name] from sysobjects");
foreach($rs as $k=>$row)
{
echo $row[0] . '
';
}
$db->disconnect();
?>
This is using ADOdb instead of PEAR::DB.
Jody
On 5/9/07, Stut wrote:
> Jody Williams wrote:
> > I have a situation where I am unable to connect to a Microsoft SQL
> > 2005 Database from Windows Server 2003 (IIS + PHP 5.0.4).
> >
> > here is the code:
> >
> > require_once 'DB.php';
> > $dsn = "mssql://aspj_transfer:XXXXXX@eggrs006/transfer_station";
> > $db = DB::connect($dsn);
> > if (DB::isError($db))
> > {
> > die ($db->getMessage().'
'.$db->getUserInfo());
> > }
> > // no useful info. just trying to return something.
> > $query = "select [name] as n from sysobjects order by [name]";
> > $data =& $db->query($query);
> > while ($row = $data->fetchRow())
> > {
> > echo $row[0]."
";
> > }
> > $db->disconnect();
> > ?>
> >
> > Here is the error:
> >
> > [DB Error: connect failed] **
> > mssql://aspj_transfer:XXXXXX@eggrs006/transfer_station
> >
> > From my workstation, this can connect just fine (Windows XP, IIS, PHP
> > 5.0.4).
> >
> > There aren't any firewalls between the machines.
> >
> > Any suggestions?
>
> Can the server you're running this on resolve eggrs006 to an IP address?
> If not, that's your problem. If it can then you need to check the SQL
> server user to make sure it can access that database from that machine.
>
> Note that it is very very very unlikely that this problem is anything to
> do with PHP or Pear::DB.
>
> -Stut
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Problem With Pear::DB
am 11.05.2007 03:52:50 von bedul
how about IP from the PHP server not the SQL server. hmm it happen to me
using mysql, i just wanna share hope help you
my mysql server 10.30.11.6 and my comp ip was 10.30.11.136
in mysql server i create account/user which the server not localhost but
10.30.11.136 and it worked..
i send to phpDB.. if there any result (reply).. i send to you
----- Original Message -----
From: "Jody Williams"
Cc:
Sent: Wednesday, May 09, 2007 10:36 PM
Subject: Re: [PHP-WIN] Problem With Pear::DB
> THat is what I thought. Just to confirm, I created an ODBC connection
> for the Windows 2k3 server to the Database using the Server name. I
> tried the IP in the PHP file and have the same results.
>
> Is there some kind of restriction that might be in place in Windows 2003?
>
> Jody
>
> On 5/9/07, Stut wrote:
> > Jody Williams wrote:
> > > I have a situation where I am unable to connect to a Microsoft SQL
> > > 2005 Database from Windows Server 2003 (IIS + PHP 5.0.4).
> > >
> > > here is the code:
> > >
> > > require_once 'DB.php';
> > > $dsn = "mssql://aspj_transfer:XXXXXX@eggrs006/transfer_station";
> > > $db = DB::connect($dsn);
> > > if (DB::isError($db))
> > > {
> > > die ($db->getMessage().'
'.$db->getUserInfo());
> > > }
> > > // no useful info. just trying to return something.
> > > $query = "select [name] as n from sysobjects order by [name]";
> > > $data =& $db->query($query);
> > > while ($row = $data->fetchRow())
> > > {
> > > echo $row[0]."
";
> > > }
> > > $db->disconnect();
> > > ?>
> > >
> > > Here is the error:
> > >
> > > [DB Error: connect failed] **
> > > mssql://aspj_transfer:XXXXXX@eggrs006/transfer_station
> > >
> > > From my workstation, this can connect just fine (Windows XP, IIS, PHP
> > > 5.0.4).
> > >
> > > There aren't any firewalls between the machines.
> > >
> > > Any suggestions?
> >
> > Can the server you're running this on resolve eggrs006 to an IP address?
> > If not, that's your problem. If it can then you need to check the SQL
> > server user to make sure it can access that database from that machine.
> >
> > Note that it is very very very unlikely that this problem is anything to
> > do with PHP or Pear::DB.
> >
> > -Stut
> >
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Problem With Pear::DB
am 11.05.2007 03:52:50 von bedul
how about IP from the PHP server not the SQL server. hmm it happen to me
using mysql, i just wanna share hope help you
my mysql server 10.30.11.6 and my comp ip was 10.30.11.136
in mysql server i create account/user which the server not localhost but
10.30.11.136 and it worked..
i send to phpDB.. if there any result (reply).. i send to you
----- Original Message -----
From: "Jody Williams"
Cc:
Sent: Wednesday, May 09, 2007 10:36 PM
Subject: Re: [PHP-WIN] Problem With Pear::DB
> THat is what I thought. Just to confirm, I created an ODBC connection
> for the Windows 2k3 server to the Database using the Server name. I
> tried the IP in the PHP file and have the same results.
>
> Is there some kind of restriction that might be in place in Windows 2003?
>
> Jody
>
> On 5/9/07, Stut wrote:
> > Jody Williams wrote:
> > > I have a situation where I am unable to connect to a Microsoft SQL
> > > 2005 Database from Windows Server 2003 (IIS + PHP 5.0.4).
> > >
> > > here is the code:
> > >
> > > require_once 'DB.php';
> > > $dsn = "mssql://aspj_transfer:XXXXXX@eggrs006/transfer_station";
> > > $db = DB::connect($dsn);
> > > if (DB::isError($db))
> > > {
> > > die ($db->getMessage().'
'.$db->getUserInfo());
> > > }
> > > // no useful info. just trying to return something.
> > > $query = "select [name] as n from sysobjects order by [name]";
> > > $data =& $db->query($query);
> > > while ($row = $data->fetchRow())
> > > {
> > > echo $row[0]."
";
> > > }
> > > $db->disconnect();
> > > ?>
> > >
> > > Here is the error:
> > >
> > > [DB Error: connect failed] **
> > > mssql://aspj_transfer:XXXXXX@eggrs006/transfer_station
> > >
> > > From my workstation, this can connect just fine (Windows XP, IIS, PHP
> > > 5.0.4).
> > >
> > > There aren't any firewalls between the machines.
> > >
> > > Any suggestions?
> >
> > Can the server you're running this on resolve eggrs006 to an IP address?
> > If not, that's your problem. If it can then you need to check the SQL
> > server user to make sure it can access that database from that machine.
> >
> > Note that it is very very very unlikely that this problem is anything to
> > do with PHP or Pear::DB.
> >
> > -Stut
> >
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php