Установка

Для того, чтобы включить поддержку PostgreSQL необходимо скомпилировать PHP с директивой --with-pgsql[=DIR] . Параметр DIR определяет путь к установочной директории PostgreSQL, по умолчанию это /usr/local/pgsql. Если доступен динамический модуль, то он может быть включен директивой extension в php.ini, либо функцией dl().

Коментарии

Автор:
Windows users should be mindful that since 5.2.6 it seems that the version of php_pgsql.dll supplied is dynamically linked and requires libpq.dll.

The version supplied in 5.2.5 is statically linked and does not have this dependency, if you cannot load the Postgres extension grab php_pgsql.dll from the 5.2.5 distribution
2009-03-02 10:59:50
http://php5.kiev.ua/manual/ru/pgsql.installation.html
Автор:
An easy way to install in ubuntu(debain)
Just run " apt-get install php5-pgsql "
2009-07-08 07:39:53
http://php5.kiev.ua/manual/ru/pgsql.installation.html
Автор:
On a Windows server, configured with Apache, adding the following line to httpd.conf to load libpq.dll can save you a lot of time : 

LoadFile "C:/Program Files/PostgreSQL/8.4/bin/libpq.dll"

Note that you will have to change your folder accordingly to the installation path and version of PostgreSQL you have installed. Also note that having Apache and PostgreSQL on the same server for production environments is not recommended. 

Cheers,
Serjik
2009-08-28 10:54:48
http://php5.kiev.ua/manual/ru/pgsql.installation.html
On PHP 5.3, you may encounter this error.
    Cannot create new link. Too many open links

I did with Archlinux. pgsql.so was active.

To resolve the issue, I had to active pdo.so and pdo_pgsql.so. Hope this helps!
2010-08-13 08:31:39
http://php5.kiev.ua/manual/ru/pgsql.installation.html
if you get 
/pgsql.c:789: error: 'from' undeclared (first use in this function)
etc. compiling in linux its a typo in the define of pgsql.c file

change to this
#if !HAVE_PQESCAPE_CONN
#define PQescapeStringConn(conn, to, from, len, error) PQescapeString(to, from, len)
#endif
2014-04-07 22:04:33
http://php5.kiev.ua/manual/ru/pgsql.installation.html
Автор:
for php 7, "sudo apt install php7.0-pgsql" worked for me
2016-08-30 00:14:09
http://php5.kiev.ua/manual/ru/pgsql.installation.html
Starting with PHP 7, on Ubuntu (i.e., 16+), you can run:

`sudo apt-get install php-pgsql`
2016-09-02 20:28:01
http://php5.kiev.ua/manual/ru/pgsql.installation.html

    Поддержать сайт на родительском проекте КГБ