我刚刚升级到 MacOS Mavericks (10.9),我正在使用 Postgres.app 安装。
我按照在 Mac OS X 上的 PHP 中启用 PostgreSQL 支持的答案中的说明进行操作,以使 PGSQL 再次可访问。我包含了 --with-pgsql=/path/to/pgsql 选项来解决“找不到 libpq-fe.h”错误,并且成功启用了 pgsql 访问。
然而,当我开始配置pdo_pgsql时,我得到了“找不到 libpq-fe.h”错误,尽管我完全按照我在上面的pgsql配置中所做的那样指定了安装路径。
这是成功pgsql配置的一个片段 - 请注意pg_config 检查响应中的双斜杠。
pgsql$ ./configure --with-pgsql=/Applications/Postgres.app/Contents/MacOS/bin/
<...>
checking for pg_config... /Applications/Postgres.app/Contents/MacOS/bin//pg_config
<...>
'pg_config' 应该是:
$ ls /Applications/Postgres.app/Contents/MacOS/bin/pg_conf*
/Applications/Postgres.app/Contents/MacOS/bin/pg_config
但是,在配置pdo_pgsql时,根本找不到 pg_config。
pdo_pgsql$ ./configure --with-pgsql=/Applications/Postgres.app/Contents/MacOS/bin/
<...>
checking for pg_config... not found
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
我尝试指定带和不带斜杠的路径,以及带或不带 bin 目录的路径,所有这些都适用于pgsql而没有一个适用于pdo_pgsql。