简体   繁体   English

PHP 启动:无法加载动态库“pgsql.so”

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

I have an application in symfony using doctrine and PGSQL.我在 symfony 中有一个使用学说和 PGSQL 的应用程序。

I'm using MacOsx BigSur.我正在使用 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我已经用brew install php@7.3

In the /etc/php.ini I added the line extension=pgsql.so of the end of file.在 /etc/php.ini 中,我添加了文件末尾的行extension=pgsql.so

I have restart my services with: brew services restart php@7.3我已经重新启动了我的服务: brew services restart php@7.3

When I run php -v I have a warning : PHP Startup: Unable to load dynamic library 'pgsql.so'当我运行 php -v 时出现警告: PHP Startup: Unable to load dynamic library 'pgsql.so'

And when I run my symfony application I have this error:当我运行我的 symfony 应用程序时,我遇到了这个错误:

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 ?如何安装 pgsql 以正确运行我的应用程序?

Thanks谢谢

To resolve my problem I have installed php@7.3 with brew为了解决我的问题,我用 brew 安装了 php@7.3

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.你可以再次运行,这就是工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM