Search Postgresql Archives

Re: Unable to connect to Postgresql

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

 



	John Iliffe wrote:

> Yes, I will do that, but there are several hundred PHP web page scripts to 
> be updated.  Presumably if one script opens two different databases then 
> both of the pg_connect() instances will need to be updated.

If you have many calls to pg_connect() without a host
in the connect string, meaning it defaults to /tmp, instead of
changing them you may inject a PGHOST variable into the Apache
environment with /var/pgsql as the value. This will make it
the default host, so basically everything that was going
implicitly to /tmp will go to /var/pgsql instead.
I think in RedHat the definition should go into /etc/sysconfig/httpd

Generally the environment variables described for libpq here:
https://www.postgresql.org/docs/9.6/static/libpq-envars.html
apply to php's pg_connect() as well, since it's really just
a thin wrapper on top of libpq's PQconnectdb().

Best regards,
-- 
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux