我试图为我的php安装启用pdo驱动程序,但是当我运行命令时

./configure --prefix=/usr/local/webserver/php --with-apxs2=/usr/local/webserver/apache2/bin/apxs --enable-mbstring --enable-intl --with-icu-dir=/usr --with-pgsql=/usr/local/webserver/postgres --with-pdo-pgsql=/usr/local/webserver/postgres

我明白了

"Unable to build the PDO PostgreSQL driver: libpq 7.4+ is required"

我在那个目录中安装了postgresql

/usr/local/webserver/postgres

我使用bin包和PHP5.3安装了postgresql 9.0.4.1

推荐答案

Pecl PDO包现在已被弃用.顺便说一句,debian包php5 pgsql现在既包括常规驱动程序,也包括PDO驱动程序,所以:

apt-get install php-pgsql

在站点可以使用Apache之前,还需要重新启动它:

sudo systemctl restart apache2

Postgresql相关问答推荐

利用PostgreSQL查询中表的顺序来计算包含每次时间的时间范围

Postgs SQL用于比较两个表之间的数据并填充到目标中

使用多个分隔符拆分SQL

如何在Windows中安装sql for golang

Postgres 11没有强制执行外键约束?

数组格式类型的PostgreSQL日期

合并两个字典并创建一个包含更新凭据的字典列表

TimescaleDB 连续聚合:如何存储连续聚合结果

从左连接更新 Postgres

Windows PSQL 命令行: is there a way to allow for passwordless login?

Select 日期最高的行

在这个 Dockerfile 中创建的 Postgres 用户名/密码在哪里?

避免 created_at 和 updated_at 由 sequelize 自动生成

从time without time zone和时区名称中获取time with time zone

如何创建 postgres 数据库模式的 sql 脚本?

Django 1.9.2 AssertionError:database connection isn't set to UTC

SqlAlchemy:多列的不同计数

在 PostgreSQL 中将列数据类型从 Text 更改为 Integer

try 为 ror 应用程序设置 postgres,出现错误 - fe_sendauth:no password supplied

如何为 adminpack 解决 PostgreSQL pgAdmin 错误Server instrumentation not installed?