意外错误,消息是:无法连接到数据库服务器'localhost'EZ发布


Unexpected error, the message was : Unable to connect to the database server 'localhost' EZ Publish

嗨,我正在使用EZ发布,当我试图访问我的网站时,我得到这个错误。

 Unexpected error, the message was : Unable to connect to the database server 'localhost'
    Error #0:  in /var/www/lib/ezdb/classes/ezpostgresqldb.php on line 125

in my

/var/www/settings/siteaccess/plain_site/site.ini.append.php
/var/www/settings/siteaccess/nor/site.ini.append.php
/var/www/settings/siteaccess/plain_site_admin/site.ini.append.php

i have defined

[DatabaseSettings]
DatabaseImplementation=ezpostgresql
Server=localhost

server as localhost,

还有我的数据库用户名和密码是正确的

也我的网站网址是正确的

[SiteSettings]
SiteName=test
SiteURL=xxxxxxx/index.php

还有我的数据库服务器是正确启动的

/etc/init.d/postgresql  restart

在我的浏览器中它只给出错误

An unexpected error has occurred. Please contact the webmaster.

1.are there any log files  i should check ?
2.what are the possible reasons for this error , thank you very much

我从来没有使用过ezpublish自己的postgresql,但如果你确信你的设置是OK的,尝试用127.0.0.1代替localhost。根据所使用的PHP库,它可以提供帮助。

如果您正在查找日志,请检查/path/to/ezp/var/log/*。如果这个目录是空的,那么请确保您的web服务器可以写入/path/to/ezp/var

检查正在使用的用户名和密码(lib/ezdb/classes/ezpostgresqldb.php)。这可能是你的设置没有被读取。确保您已经在您的override site.ini (settings/override/site.ini)中正确加载了站点访问。这听起来像你有你的连接字符串在你的站点访问ini文件中排列,但是你的站点访问没有被加载。

相关文章: