我使用docker-compose创建一个使用Nginx和PostgreSQL操作的zabbix容器,但它生成以下错误Parse错误:
语法错误,意外&#39 ;;'在/etc/zabbix/web/zabbix.conf.php上 第24行。
我不明白这一点,因为它在几分钟前工作正常。
搬运工-compose.yaml
version: '3.1'
services:
postgres:
image: postgres
restart: always
environment:
POSTGRES_USER: zabbix
POSTGRES_PASSWORD: zabbix
POSTGRES_DB: zabbix
zabbix-server:
image: zabbix/zabbix-server-pgsql
restart: always
environment:
DB_SERVER_HOST: postgres
POSTGRES_USER: zabbix
POSTGRES_PASSWORD: zabbix
POSTGRES_DB: zabbix
depends_on:
- postgres
zabbix-web:
image: zabbix/zabbix-web-nginx-pgsql
restart: always
environment:
ZBX_SERVER_HOST: zabbix-server
DB_SERVER_HOST: postgres
POSTGRES_USER: zabbix
POSTGRES_PASSWORD: zabbix
POSTGRES_DB: zabbix
depends_on:
- postgres
- zabbix-server
ports:
- 8081:80
答案 0 :(得分:2)
检查您的zabbix.con.php文件是否具有此形状。您可以在zabbix Web容器中找到此文件。
<?php
// Zabbix GUI configuration file.
global $DB, $HISTORY;
$DB['TYPE'] = 'POSTGRESQL';
$DB['SERVER'] = 'postgres';
$DB['PORT'] = '5432';
$DB['DATABASE'] = 'zabbix';
$DB['USER'] = 'zabbix';
$DB['PASSWORD'] = 'zabbix';
// Schema name. Used for IBM DB2 and PostgreSQL.
$DB['SCHEMA'] = '';
$ZBX_SERVER = 'zabbix-server';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = 'Zabbix docker';
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
// Elasticsearch url (can be string if same url is used for all types).
$HISTORY['url'] = '';
// Value types stored in Elasticsearch.
$HISTORY['types'] = '';
通常会在代码中的某处出现一个等于后跟分号的错误,从而产生错误。