PHP can't connect to PostgreSQL on CentOS 7

后端 未结 1 1867
独厮守ぢ
独厮守ぢ 2021-01-02 10:20

I have CentOS 7 running in VirtualBox on OSX. Apache, PHP 5.4 and PostgreSQL 9.2 are all running. But, when my (simple) php-script tries to connect to PostgreSQL it doesn\'t

相关标签:
1条回答
  • 2021-01-02 10:37

    Probably SELinux is blocking your database connection.

    Make sure that you set the correct boolean to allow your web application to talk to the database:

    sudo setsebool -P httpd_can_network_connect_db 1
    
    0 讨论(0)
提交回复
热议问题