如何使用 --with-pgsql 重新编译 PHP

2 linux postgresql php amazon-ec2

我已将 postgresql、php 和 apache 安装到 Amazon Linux AMI。现在我想使用phpPgAdmin,它提示“您的PHP安装不支持PostgreSQL。您需要使用--with-pgsql配置选项重新编译PHP。”!如何为 Amazon Linux AMI 重新编译它?请建议。谢谢。

小智 5

如果您的操作系统基于 RPM ( Fedora/CentOS ) 并且您从RPM安装了PHP,请执行以下命令:

yum install php-pgsql
Run Code Online (Sandbox Code Playgroud)

如果您的操作系统基于 Debian ( Ubuntu/Debian ),请执行以下命令:

apt-get install php5-pgsql
Run Code Online (Sandbox Code Playgroud)

不要忘记重新启动 Apache 服务以使更改生效。