0

I have an application in symfony using doctrine and PGSQL.

I'm using MacOsx BigSur.

When I run my projet I have this error:

PHP Startup: Unable to load dynamic library 'pgsql.so'

I have install php@7.3 with brew install php@7.3

In the /etc/php.ini I added the line extension=pgsql.so of the end of file.

I have restart my services with: brew services restart php@7.3

When I run php -v I have a warning : PHP Startup: Unable to load dynamic library 'pgsql.so'

And when I run my symfony application I have this error:

In AbstractPostgreSQLDriver.php line 79:
                                                          
  An exception occurred in driver: could not find driver  
                                                          

In PDOConnection.php line 31:
                         
  could not find driver  
                         

In PDOConnection.php line 27:
                         
  could not find driver 

How can I install pgsql to run my application correctly ?

Thanks

  • 1
    I believe you have to install the pgsql extension. There should be a flag for that when installing the PHP using Homebrew. You can have a look here and check if it helps: https://stackoverflow.com/a/29708119/3551690 – diegopso Jul 30 '21 at 10:53
  • I have tried this command line but it's obsolete –  Jul 30 '21 at 11:04

1 Answers1

0

To resolve my problem I have installed php@7.3 with brew

brew install php@7.3 

After that you need to do:

echo ‘export PATH=“/usr/local/opt/php@7.3/bin:$PATH”’ >> ~/.profile
echo ‘export PATH=“/usr/local/opt/php@7.3/sbin:$PATH”’ >> ~/.profile

You can run again and that's work.