在Ubuntu 16.04 下面通过 apt-get 安装的php 版本都是7.0。我们只需安装对应的pdo即可。在命令窗口下执行:sudo apt-get install php7.0-pgsql即可。