【问题标题】:Unable to install php_pgsql in AWS ElasticBeanstalk无法在 AWS ElasticBeanstalk 中安装 php_pgsql
【发布时间】:2016-06-07 14:00:58
【问题描述】:

我正在尝试从 EB 连接到 RDS 实例。但是我收到了这个讨厌的错误

Fatal error: Call to undefined function pg_connect()

我尝试通过在 .ebextensions 文件夹中创建包含以下内容的 packages.config 文件来安装 php_pgsql。

packages:
    yum:
        php56-pgsql: []
    commands:
        01-install-pglib:
            command: "yum install -y postgresql94-libs"
        02-install-pg:
            command: "yum install -y php56-pgsql"
        03-install-pg:
            command: "service httpd restart"

但它不起作用。有什么方法可以在 ElasticBeanstalk 中为 PHP 安装 pg 客户端。

【问题讨论】:

  • 我觉得你需要使用PDO来连接RDS PostgreSQL

标签: php postgresql amazon-web-services amazon-elastic-beanstalk


【解决方案1】:

我能够通过以下命令解决此问题。

container_commands: 
  110-remove-pg: 
    command: "yum remove -y php56-pgsql"
  120-install-pglib: 
    command: "yum install -y postgresql94-libs"
  130-install-pg: 
    command: "yum install -y php56-pgsql"

希望对某人有所帮助。

【讨论】:

    猜你喜欢
    • 2020-11-01
    • 2018-03-16
    • 2016-09-14
    • 2018-04-14
    • 2016-01-01
    • 2013-12-31
    • 2018-03-05
    • 2017-05-30
    • 2015-12-22
    相关资源
    最近更新 更多