Update 10 November 2013: after updating Mavericks from GM to build 13A603, everything broke again. After recompiling like specified below nothing was working and there may have been a missing path somewhere in the php.ini-file. While tracking the error down, I stumbled over a new version of PHP with a one-line install on http://www.coolestguidesontheplanet.com. I decided on 5.5 while I was at it.:
easy PHP 5.5-installation
Just running the installation command, a curl, the postgres-connection was working again, even from a non-standard postgres-installation. Thumbs up.
--
I updated a few of my computers to Mac OS X 10.9 Mavericks. Everything went fine, or so I thought until my wife complained about a missing blog. I happen to run this blog on Dotclear using a Postgres.app-database. Dotclear is of course using php and Apache.
Soon it was clear that the good folks at Apple have dropped support for Postgres in their php-configuration, so what to do. But I found this rather helpful page:
http://blog.rupey.org/post/63221360055/adding-postgres-support-to-php-on-os-x-mavericks
It was not perfect though, as a few steps were a bit shorthanded: installing autoconf from brew for instance, but that was fairly easy after a bit of googling, so I won’t repeat those steps here. See here, if you like.
I think that Rupey gets it very right for the rest, that is if you have Postgres installed by hand, i.e. that it is comfortably sitting in /usr/local/pgsql/ or similar. Given that I had used the app-version - much simpler to install and run - I had to point the configuration to the right directory. So when doing this
cd ext/pdo_pgsql
phpize
./configure
I ended up with this error:
checking for pg_config... not found
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
To point out the right installation path I just had to do this:
./configure --with-pdo-pgsql=/Applications/Postgres.app/Contents/MacOS/bin
before doing the rest:
make
sudo make install
and finally adding extension=pdo_pgsql.so to /etc/php.ini (and changing the time zone) and doing a sudo httpd -k graceful to make php work with Postgres again. Sorry for the downtime, btw.