无法在AWS ElasticBeanstalk中安装php_pgsql

时间:2016-02-25 01:10:46

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

我正在尝试从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客户端。

1 个答案:

答案 0 :(得分:0)

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

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"

希望它有所帮助。

相关问题