1

I want to use postgresql on my laravel project, and I have enabled extensions for pdo_pgsql and pgsql in php.ini (php 8.2); however, I face two problems below:

Warning: PHP Startup: Unable to load dynamic library 'pdo_pgsql'
Warning: PHP Startup: Unable to load dynamic library 'pgsql' 

Does anyone know how to install them?

I expect to connect with my postgresql db

  • Do you have Postgres itself installed? Are both PHP and Postgres from Homebrew? – tadman Dec 29 '22 at 20:17
  • I installed php8.2 with https://github.com/shivammathur/homebrew-php and postgres with https://www.postgresql.org – Punrong Rany Dec 29 '22 at 20:30
  • It's quite often the case that Homebrew packages depend on other Homebrew installations, so it might be worth trying the Homebrew Postgres installer as well to fill in missing libraries. If that doesn't work, it's easy to uninstall with `brew`. – tadman Dec 29 '22 at 21:09
  • Postgres server is fine. I can put it up and running. My problem revolves around how to install these two extensions, namely, pdo_pgsql and pgsql for php8.2 – Punrong Rany Dec 29 '22 at 22:02
  • because without these two libraries, I always get warnings – Punrong Rany Dec 29 '22 at 22:03
  • Are you sure they're missing and it's not just a problem with those libraries loading? I've seen it's often the case that those depend on another shared library that's not where it's supposed to be, as in maybe it's looking for a specific Homebrew version of it. – tadman Dec 29 '22 at 22:31
  • 1
    Thank you! I have got my issue fixed – Punrong Rany Jan 31 '23 at 20:18

0 Answers0