Connection problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi,
I try to connect to a PostgreSQL database from my php script, and get the following error:

Warning: Unable to connect to PostgreSQL server: FATAL 1: Database "www-data" does not exist in the system 
catalog. in /home/lao/proj/hajnalcsillag/www/classes/DBConnection.php on line 10

The code is:
<?

class DBConnection
{
    var $con_string;

    function DBConnection()
    {
        $con_string = "dbname=hajnalcsillag user=lao password=abc123 host=localhost port=5432";
        $ret = pg_connect( $this->con_string );
    }
}

?>

I could solve part of the problem by creating a user and database called 'www-data'. 
Since I have several sites on the same server, I need more independent db-s, so this solution is not enough.
This seems to be a configuration problem, but I don't know where to turn off this (security?) option.

The versions are:
PHP Version 4.1.0RC1
PostgreSQL 7.1.3
Apache/1.3.22
Debian sid

Could anyone help me please?
Thanks, Peter


[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux