PHP 启动:无法加载动态库 PGSQL [英] PHP Startup : Unable to load dynamic library PGSQL
问题描述
我正在尝试使用以下命令运行 Symfony 3.x:
I'am trying to run Symfony 3.x with :
- Ubuntu 16.04
- PHP 7.0
- NGinx
我想与我创建的 PGSQL 数据库进行交互,但出现此错误:
I would like to interact with my PGSQL database that I created but I get this error :
PHP 警告:PHP 启动:无法加载动态库'/usr/lib/php/20151012/php_pdo_pgsql.dll' -/usr/lib/php/20151012/php_pdo_pgsql.dll:无法打开共享对象file: 第 0 行的 Unknown 中没有这样的文件或目录
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_pdo_pgsql.dll' - /usr/lib/php/20151012/php_pdo_pgsql.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[Doctrine\DBAL\Exception\DriverException] 一个驱动程序发生异常:找不到驱动程序
[Doctrine\DBAL\Driver\PDOException] 找不到驱动
[Doctrine\DBAL\Exception\DriverException] An
exception occured in driver: could not find driver
[Doctrine\DBAL\Driver\PDOException] could not find driver
[PDOException] 找不到驱动
[PDOException] could not find driver
于是我查看了我的 phpinfo()
似乎启用了 pgsql 驱动程序
So I looked at my phpinfo()
and it seems that pgsql driver is enabled
谁能帮我解决这个问题?
Can anyone help me on this one ?
推荐答案
您必须正确安装 PostgreSQL 模块并启用它.http://php.net/manual/en/pgsql.installation.php
You must properly install the PostgreSQL module and enable it. http://php.net/manual/en/pgsql.installation.php
附言不要在基于 UNIX 的操作系统的服务器上使用.dll"文件,因为这些扩展是为 Windows 操作系统编译的(对于基于 UNIX 的操作系统,您必须使用.so"文件).
P.S. do not use '.dll' files on the servers with UNIX based OS, because these extensions are compiled for the Windows operating system (for UNIX based OS you must use '.so' files).
这篇关于PHP 启动:无法加载动态库 PGSQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!