0

I've just upgraded to MacOS Mavericks (10.9) and I'm using the Postgres.app install.

I followed the instructions in the answer to Enabling PostgreSQL support in PHP on Mac OS X to make PGSQL accessible again. I included the --with-pgsql=/path/to/pgsql option to address the "Cannot find libpq-fe.h" error and pgsql access is successfully enabled.

However, when I came to configuring pdo_pgsql I got the "Cannot find libpq-fe.h" error despite specifying the install path exactly as I did in the pgsql configuration above.

Here's a snip from the successful pgsql config - note the double slash in the pg_config check response.

pgsql$ ./configure --with-pgsql=/Applications/Postgres.app/Contents/MacOS/bin/
<...>
checking for pg_config... /Applications/Postgres.app/Contents/MacOS/bin//pg_config
<...>

'pg_config' is where it should be:

$ ls /Applications/Postgres.app/Contents/MacOS/bin/pg_conf*
/Applications/Postgres.app/Contents/MacOS/bin/pg_config

But, when configuring pdo_pgsql, pg_config is not found at all.

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

I have tried specifying the path with and without trailing slash, and with or without the bin directory, all of which work with pgsql and none of which work with pdo_pgsql.

Community
  • 1
  • 1
  • possible duplicate of [Impossible to Install PG gem on my mac with Mavericks](http://stackoverflow.com/questions/19625487/impossible-to-install-pg-gem-on-my-mac-with-mavericks) – Giacomo1968 Nov 28 '13 at 18:29
  • Hmm... I checked that out, but don't see the link to PDO being unavailable on a successful working installation of PHP/PGSQL. Can you be more specific? – Bryan McLennon Nov 28 '13 at 18:38
  • The [docs](http://www.php.net/manual/en/ref.pdo-pgsql.php) say that the option for the PDO_PGSQL driver is `--with-pdo-pgsql[=DIR]' – Milen A. Radev Nov 28 '13 at 18:50
  • Milen: Thanks! I'm so embarrassed - I'd just returned to this page to make this note after looking at the header of the configure script. "Read the doc first!" – Bryan McLennon Nov 28 '13 at 18:54

1 Answers1

2
$./configure --with-pdo-pgsql=/Applications/Postgres.app/Contents/Versions/9.4

It worked for me.

arogachev
  • 33,150
  • 7
  • 114
  • 117