1

我正在尝试使用 Postgres 安装 Joomla,在安装程序中出现以下错误:

Could not connect to the database. Connector returned number: Error connecting to PGSQL database.

这并没有告诉我太多。有任何想法吗?

4

2 回答 2

3

不幸的是,安装程序没有返回真正的错误。

以下是一些一般提示:

  • 确保提供的数据库已经存在
  • 检查您的数据库是否需要一些特定的设置,例如不同的端口或sslmode=require

将您的连接详细信息放在一个普通的 php 文件中并运行脚本,启用错误报告:

<?php
$connection = 'host=127.0.0.1 port=5432 dbname=joomla3 user=postgres password=postgres';
$dbconn = pg_connect($connection);

var_dump($dbconn);

运行脚本时,您可能会收到正确的错误。获取资源后,连接成功:resource(4) of type (pgsql link)

于 2014-03-11T11:08:31.910 回答
0

检查 selinux 配置:

$ sudo setenforce Permissive

然后再试一次。如果可行,您可以在 /etc/selinux/config 禁用 selinux 并更改行

SELINUX=enforcing

经过

 SELINUX=permissive
于 2017-05-24T16:55:53.183 回答