Error connecting to PGSQL database in Joomla

旧时模样 提交于 2019-12-11 05:34:08

问题


I am trying to install Joomla using Postgres and in the installer I have the following error:

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

This isn't telling me very much. Any ideas?


回答1:


Unfortunately the installer does not return the real error.

Here are some general tips:

  • make sure the provided database already exists
  • check if your database needs some specific settings, such as a different port or sslmode=require

Put your connection details in a normal php file and run the script, having error reporting enabled:

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

var_dump($dbconn);

When running the script you might get a proper error. When you get a resource, the connection is successful: resource(4) of type (pgsql link)




回答2:


Check selinux configuration:

$ sudo setenforce Permissive

and try again. If it works you can disable selinux at /etc/selinux/config and change the line

SELINUX=enforcing

by

 SELINUX=permissive


来源:https://stackoverflow.com/questions/22323906/error-connecting-to-pgsql-database-in-joomla

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!