Hans Rakers wrote:
>
> Can any of you tell me how i configure PostgreSQL for access by PHP? I
> have PHP compiled as a Apache module (with pgsql support ofcourse), and
> Apache runs under nobody:nogroup. What needs to be done to be able to
> use pgsql via PHP with regards to what users need to be added, what
> files need editing and how to make the whole thing secure?
I'm not using PHP, but I am using Apache with pgsql (and modperl).
My choice was to create a single user (see CREATE USER in the docs)
who owns the apache processes and through which all db queries are
performed.
BTW, it is commonly considered a security hole to run as user nobody
because a number of programs do so (compromise one, compromise all).
Maybe better to create a special-purpose user (e.g., 'www) to own your
apache processes.
> Also i'm having trouble using postgresadmin from www.phpwizard.net. It
> displays the following error:
>
> --
> Warning: Unable to connect to PostgresSQL server: FATAL 1: Database
> dbname=template1 does not exist in pg_database in lib.inc.php3 on line
> 125
> --
>
> Although the database template1 does exist when loging in as the
> postgres superuser and executing 'psql template1'. Am i doing anything
> wrong here??
Hmmm...is your failing account missing the PGDATA env variable
setting??
Cheers,
Ed Loehr