I use the apache SetEnv directive to set PGHOST and specify what postgres database server to use.
This allows me to use the same code for my development and production servers without modification. It works well for perl/DBI but PHP seems to ignore this setting?
I use the apache SetEnv directive to set PGHOST and specify what postgres database server to use.This allows me to use the same code for my development and production servers without modification. It works well for perl/DBI but PHP seems to ignore this setting?
That doesn't sound right -- especially considering you're setting the variable in the Apache conf file. Anyway, have you tried using PHP's [MAN]setenv[/MAN] function?
-- Gary
It does see the PGHOST environment variable, it just ignores it.
I can get around it by adding host=$PGHOST to my connect string, so it's not a big deal. But really, the postgres code should do that for me.