Centos下安装php PDO PostgreSQL扩展

1.安装 wget http://pecl.php.net/get/PDO_PGSQL-1.0.2.tgz tar -zxvf PDO_PGSQL-1.0.2.tgz cd PDO_PGSQL-1.0.2 ~/odp/php/bin/phpize export PGSQL_INCLUDE=/home/users/yanjingang/postgresql/include export PGSQL_LIBDIR=/home/users/yanjingang/postgresql/lib ./configure –with-php-config=/home/users/yanjingang/odp/php/bin/php-config –with-pdo-pgsql=/home/users/yanjingang/postgresql/ –with-pgsql=/home/users/yanjingang/postgresql/ make && make install 2.配置 vim odp/php/etc/ext/pdo_pgsql.ini   添加 [pdo_pgsql] extension=”pdo_pgsql.so” ~/odp/php/sbin/php-fpm restart ~/odp/webserver/bin/lighttpd.sh restart 3.done

Centos安装部署PostgreSQL

安装:

wget https://ftp.postgresql.org/pub/source/v9.4.4/postgresql-9.4.4.tar.gz –no-check-certificate tar -zxvf postgresql-9.4.4.tar.gz cd postgresql-9.4.4 ./configure –prefix=/home/users/yanjingang/postgresql make make install 启动: cd /home/users/yanjingang/postgresql mkdir data ./bin/initdb -D /home/users/yanjingang/postgresql/data/ vim ./data/postgresql.conf    修改data目录下的配置信息 /home/users/yanjingang/postgresql/bin/pg_ctl -D /home/users/yanjingang/postgresql/data/ -l logfile start    启动实例 ./bin/psql postgres -p5433 需要指定端口,否则会进入默认端口实例中