Home  >  Article  >  php教程  >  centos下安装php的PDO PostgreSQL扩展

centos下安装php的PDO PostgreSQL扩展

WBOY
WBOYOriginal
2016-06-06 19:36:002192browse

在 安装 php后重新 安装 一些 扩展 的时候遇到问题: 先谈下如何 安装 posgresql的php 扩展 1、首先到:http://pecl.php.net/package/PDO_PGSQL下载 PDO_PGSQL-1.0.2.tgz 扩展 包 2、解压后进入PDO_PGSQL-1.0.2 根据php 安装 位置 执行 /usr/local/php/bin/p

安装php后重新安装一些扩展的时候遇到问题:

先谈下如何安装posgresql的php扩展

1、首先到:http://pecl.php.net/package/PDO_PGSQL 下载 PDO_PGSQL-1.0.2.tgz扩展
2、解压后进入PDO_PGSQL-1.0.2 根据php安装位置 执行 /usr/local/php/bin/phpize;
3、接着配置./configure –with-php-config=/usr/local/php/bin/php-config
4、make && make install 编译安装
5、将编译完的扩展extension=pdo_pgsql.so添加到 php.ini 最后 重启php-fpm 重启 nginx 即可生效
 

在config php的时候可能出现

configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path

解决办法:

       yum install postgresql-devel ,重新编译PHP即可。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn