I've searched high and low and haven't found anything. Perhaps I don't know what to search for.
Environment is Ubuntu Lucid (10.4) with PHP 5.2.4 & PostgreSQL 9.2.
PHP is "held" at 5.2.4 with dpkg --set-selections
. I can only find a 5.2.6 version of php5-pgsql, and when I try to install using dpkg, it complains that PHP is at 5.2.4.
Trial run with aptitude install php5-pgsql
tells me that it wants to upgrade to PHP 5.3.
Edit: Upgrading PHP is not currently an option.
I should add: I tried building PHP 5.2.4 from source using --with-pgsql --with-pdo-pgsql
. Did not get any extensions as a result. Both libpq and libpq-dev are installed.
Best Answer
This appears to do the trick:
libpq5
andlibpq-dev
are installed.cd php_x.x.x/ext/pgsql
phpize
./configure
make
sudo make install
php.ini
to addextension=pgsql.so
and any necessary other pgsql directives.