Discussion:
PEAR DB Error message
Pete
2004-06-02 14:37:42 UTC
Permalink
Hi,

our internet provider Schlund & Partner updated the his php installation last wednesday.
I updated our site at about the same time. But I uploaded a new homepage version which uses PEAR.
It is all pretty much set up right except that now I am getting an error message when my script tries to connect to the database.

Fatal error: DB Error: connect failed in /homepages/24/d32514389/htdocs/_pear/pear/PEAR.php on line 762
http://dentona.de/pages/news.php?language=de&mehr=TRUE

I can not figure out what could be wrong. I am using the db class.
It is configured like this

<?php

$dsn = array(
'phptype' => 'mysql',
'username' => 'root',
'password' => 'test',
'hostspec' => 'localhost',
'database' => 'ourdb',
);

$options = array(
'debug' => 2,
'portability' => DB_PORTABILITY_ALL,
);
?>

Could anybody please help me ?

Thank you very much.

Pete
Torsten Roehr
2004-06-02 17:48:28 UTC
Permalink
Hi Pete,

have you tried connecting with PHP's native MySQL functions?

Regards,

Torsten Roehr

PS. Also hosting with S+P. No critical problems yet... they are doing a
great job, IMHO.


"Pete" <***@dentona.de> wrote in message news:***@pb1.pair.com...
Hi,

our internet provider Schlund & Partner updated the his php installation
last wednesday.
I updated our site at about the same time. But I uploaded a new homepage
version which uses PEAR.
It is all pretty much set up right except that now I am getting an error
message when my script tries to connect to the database.

Fatal error: DB Error: connect failed in
/homepages/24/d32514389/htdocs/_pear/pear/PEAR.php on line 762
http://dentona.de/pages/news.php?language=de&mehr=TRUE

I can not figure out what could be wrong. I am using the db class.
It is configured like this

<?php

$dsn = array(
'phptype' => 'mysql',
'username' => 'root',
'password' => 'test',
'hostspec' => 'localhost',
'database' => 'ourdb',
);

$options = array(
'debug' => 2,
'portability' => DB_PORTABILITY_ALL,
);
?>

Could anybody please help me ?

Thank you very much.

Pete
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Pete
2004-06-03 08:12:57 UTC
Permalink
Hi,
Post by Torsten Roehr
have you tried connecting with PHP's native MySQL functions?
yes it works. It also works fine with PEAR on my local machine.
I am new to PEAR and don't know where to look for the problem.

Thank you very much.

Pete
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Pete
2004-06-03 10:30:56 UTC
Permalink
I just received the following support from my webhost.

<support>
I looked at your config.php file in the root directory and couldn't find any
misconfiguration there.
But I am not really familiar with the syntax either. On the database server
I couldn't find any signs of access to the database int he logfiles. I
called the script home.php from the command line with "strace php4
home.php4".
The following line caught my attention:
connect(5, {sin_family=AF_UNIX, path="/var/run/mysqld/mysqld.sock"}, 110)
= -1 ENOENT (No such file or directory)
If I interpret this the right way, the script tries to open a socket on the
local server. But the databases are running on another server. I really
don't know PEAR that well in order to be able to judge where you would tell
the server not to use the localhost. But maybe this already helps
you</support>

Unfortunately it doesn't help.
I am using the following method to connect:

require_once 'DB.php';

$dsn = array(
'phptype' => 'mysql',
'username' => 'someuser',
'password' => 'apasswd',
'hostspec' => 'db.ourhost.com',
'database' => 'thedb',
);

$options = array(
'debug' => 2,
'portability' => DB_PORTABILITY_ALL,
);

$db =& DB::connect($dsn, $options);
if (DB::isError($db)) {
die($db->getMessage());
}

I keep getting the following error message:
Fatal error: DB Error: connect failed in
/homepages/24/dirabcd/htdocs/_pear/pear/PEAR.php on line 762

It is driving me insane.
Could anybody please help me out here ?

Thx
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Continue reading on narkive:
Loading...