Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 意外错误,消息为:无法连接到数据库服务器';本地主机';EZ发布_Php_Apache_Postgresql_Ezpublish - Fatal编程技术网

Php 意外错误,消息为:无法连接到数据库服务器';本地主机';EZ发布

Php 意外错误,消息为:无法连接到数据库服务器';本地主机';EZ发布,php,apache,postgresql,ezpublish,Php,Apache,Postgresql,Ezpublish,嗨,我在使用EZ publish,当我试图访问我的网站时,我收到了这个错误 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 在我的 /var/www/settings/siteaccess/plain_site/si

嗨,我在使用EZ publish,当我试图访问我的网站时,我收到了这个错误

 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
在我的

/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
我已经定义了

[DatabaseSettings]
DatabaseImplementation=ezpostgresql
Server=localhost
服务器作为本地主机

此外,我的数据库用户名和密码是正确的

此外,我的网站网址是正确的

[SiteSettings]
SiteName=test
SiteURL=xxxxxxx/index.php
我的数据库服务器也正常启动

/etc/init.d/postgresql  restart
在我的web浏览器中,它只给出错误

An unexpected error has occurred. Please contact the webmaster.
所以


检查正在使用的用户名和密码(
lib/ezdb/classes/ezpostgresqldb.php
)。
可能是您的in设置未被读取。确保已将siteaccess正确加载到override site.ini(
设置/override/site.ini
)中。听起来你的siteaccess ini文件中有连接字符串,但没有加载你的siteaccess。

我自己从未将postgresql与eZ Publish一起使用过,但如果你确定你的设置正常,请尝试用
127.0.0.1
替换
localhost
。根据所使用的PHP库,它会有所帮助


如果要查找日志,请选中
/path/to/ezp/var/log/*
。如果此目录为空,请确保您的Web服务器可以写入lib/ezdb/classes/ezpostgresqldb.php中的
/path/to/ezp/var
连接字符串
&
日志文件
,我选中了$server=$this->server$端口=$this->port$db=$this->db$用户=$this->user$密码=$this->password;从所有字段中,我得到了正确的数据,但端口不是我指定的,这是一个问题吗,我应该定义一个端口吗?同样在设置/覆盖中,我没有site.ini文件,我只有site.ini.append.php??为什么
1.are there any log files  i should check ?
2.what are the possible reasons for this error , thank you very much