Damian Georgiou

Registered
Jun 30, 2016
3
0
1
Australia
cPanel Access Level
Root Administrator
I have tried installing pdo_pgsql a number of ways but without success.

  1. Easyapache 3 doesn't have it available in the exhaustive custom list (PHP 5.5.37)
    only pdo sqlite and mysql is available

  2. Software -> Module Installers -> PHP PECL fails to install (see below)
Code:
[running: make[/I]
[I]/bin/sh /root/tmp/pear/pear-build-root3VcYqR/PDO_PGSQL-1.0.2/libtool --mode=compile cc -I  -I. -I/root/tmp/pear/PDO_PGSQL -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-root3VcYqR/PDO_PGSQL-1.0.2/include -I/root/tmp/pear/pear-build-root3VcYqR/PDO_PGSQL-1.0.2/main -I/root/tmp/pear/PDO_PGSQL -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /root/tmp/pear/PDO_PGSQL/pdo_pgsql.c -o pdo_pgsql.lo[/I]
[I]mkdir .libs[/I]
[I] cc -I -I. -I/root/tmp/pear/PDO_PGSQL -DPHP_ATOM_INC -I/root/tmp/pear/pear-build-root3VcYqR/PDO_PGSQL-1.0.2/include -I/root/tmp/pear/pear-build-root3VcYqR/PDO_PGSQL-1.0.2/main -I/root/tmp/pear/PDO_PGSQL -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/tmp/pear/PDO_PGSQL/pdo_pgsql.c  -fPIC -DPIC -o .libs/pdo_pgsql.o[/I]
[I]/root/tmp/pear/PDO_PGSQL/pdo_pgsql.c:22:20: error: config.h: No such file or directory[/I]
[I]make: *** [pdo_pgsql.lo] Error 1[/I]
[I]ERROR: `make' failed[/I]
[I]The pdo_pgsql.so object is not in /usr/local/lib/php/extensions/no-debug-non-zts-20121212
Any thoughts?
 
Last edited by a moderator:

Damian Georgiou

Registered
Jun 30, 2016
3
0
1
Australia
cPanel Access Level
Root Administrator
Yes postgreSQL is installed on the system and has been in operation for the last 3 years using php pg_connect. Unfortunately a new app to be installed requires PDO.

Code:
PostgreSQL 8.4.20 on x86_64-redhat-linux-gnu, compiled by GCC gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17), 64-bit
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Hello,

Here's an unsupported guide on installing the module with EasyApache 3. Keep in mind the PostgreSQL driver for PDO was last released in 2006 and it's generally a better idea to consult with the developer of the script you are using to see the available alternatives.

Code:
cd /root/
wget http://pecl.php.net/get/PDO_PGSQL-1.0.2.tgz
tar -xzf PDO_PGSQL-1.0.2.tgz
cd PDO_PGSQL-1.0.2/
phpize
./configure
make && make install
Next, edit your php.ini file and add the following entry before saving and restarting Apache:

Code:
extension=pdo_pgsql.so
Thank you.