0

I am using docker-compose to create a zabbix container operating with Nginx and PostgreSQL but it generates the following error Parse error:

syntax error, unexpected ';' in /etc/zabbix/web/zabbix.conf.php on line 24.

I do not understand this because it was working correctly a few minutes ago.

docker-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
Pradeep
  • 9,667
  • 13
  • 27
  • 34
trok brk
  • 159
  • 2
  • 3
  • 13

1 Answers1

2

Check that your zabbix.con.php file has this shape. You can find this file in the zabbix web container.

<?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'] = '';

It usually happens that somewhere in the code there is an equals followed by a semicolon whereby the error is generated.

pete
  • 355
  • 3
  • 14