简体   繁体   English

PHP 7.1 PDO Postgres“找不到驱动程序”AWS EC2上的异常 Linux AMI

[英]PHP 7.1 PDO Postgres "could not find driver" exception on AWS EC2 Linux AMI

Running PHP 7.1 on an AWS EC2 instance using the Amazon Linux AMI, my PHP application is giving the following exception while trying to connect to a PostgeSQL database with PDO: Running PHP 7.1 on an AWS EC2 instance using the Amazon Linux AMI, my PHP application is giving the following exception while trying to connect to a PostgeSQL database with PDO:

uncaught exception "could not find driver"

Looking in /etc/php.d/ it looks like no PostgreSQL driver is installed.查看/etc/php.d/似乎没有安装 PostgreSQL 驱动程序。 How do I install the PHP 7.1 PDO driver for PostgreSQL on Amazon Linux?如何在 Amazon ZEDC9F0A5A5D67797BF318E3 上安装 PostgreSQL 的 PHP 7.1 PDO 驱动程序?

On Amazon Linux for PHP 7.1, the command you're looking for is:在 PHP 7.1 的 Amazon Linux 上,您要查找的命令是:

sudo yum install php71-pgsql

Yum should find a package named php71-pgsql-7.1.33-1.43.amzn1.x86_64 from the amzn-updates repo. Yum 应该从amzn-updates存储库中找到名为php71-pgsql-7.1.33-1.43.amzn1.x86_64的 package。

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

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