Pdo_pgsql has been added to homebrew core but still getting an error

(Christopher Schmitz) #1

So I’ve been reading about homebrew-php was deprecated and certain features were moved into homebrew core. I also read that pdo_pgsql was one of the things moved into core.

That’s great, though I’m still getting an error about postgres:

PHP Startup: Unable to load dynamic library ‘/usr/local/opt/php71-pdo-pgsql/pdo_pgsql.so’ - dlopen(/usr/local/opt/php71-pdo-pgsql/pdo_pgsql.so, 9): image not found in Unknown on line 0

I’ve gone through my php.ini and I have no references to this file so I don’t know where it’s getting pulled from.

Is there a way to debug or resolve this issue? I’m currently trying to setup a linux environment so I can just get back up and running, but it would be really great to have the pdo for postgres running locally again.


(Eduard Rozenberg) #2

Yes, if you’re using the latest homebrew php (7.1, 7.2, etc), pdo pgsql is built-in.

Your error likely comes from a file in /usr/local/etc/php/7.1/conf.d that tries to load that module. You would need to delete that file, or comment out the line that loads the module.

If it’s not that, use the grep hammer:
sudo grep -r pdo_pgsql.so /usr/local/etc

(Christopher Schmitz) #3

Fantastic, that did it. I didn’t think to look in the conf.d folder and as soon as I read your post I had a facepalm moment. Thanks for the help!