Starting with PHP 7, on Ubuntu (i.e., 16+), you can run:
`sudo apt-get install php-pgsql`
PHP - Manual: 安装
2025-03-12
为启用 PostgreSQL 支持,编译 PHP 时需要 --with-pgsql[=DIR]。DIR
是 PostgreSQL 的基本安装目录,默认是 /usr/local/pgsql。如果共享对象模块可用,可以使用 php.ini
中的 extension 指令或者 dl() 函数加载 PostgreSQL 模块。
Starting with PHP 7, on Ubuntu (i.e., 16+), you can run:
`sudo apt-get install php-pgsql`