docker-phpLDAPadmin: Parse error: syntax error, unexpected '}' in /container/service/phpldapadmin/assets/config.php on line 68

running in docker-compose, relevant section is:

 phpldapadmin:
    image: osixia/phpldapadmin:0.6.8
    container_name: phpldapadmin_container
    depends_on:
    - ldap
    ports:
      - "8092:80"
    environment:
      - PHPLDAPADMIN_LDAP_HOSTS=ldap
      - PHPLDAPADMIN_HTTPS=false

docker-compose up output (filtered for specific container):

phpldapadmin_container | *** CONTAINER_LOG_LEVEL = 3 (info)
phpldapadmin_container | *** Search service in CONTAINER_SERVICE_DIR = /container/service :
phpldapadmin_container | *** link /container/service/:apache2/startup.sh to /container/run/startup/:apache2
phpldapadmin_container | *** link /container/service/:apache2/process.sh to /container/run/process/:apache2/run
phpldapadmin_container | *** link /container/service/:cfssl/startup.sh to /container/run/startup/:cfssl
phpldapadmin_container | *** link /container/service/:cron/startup.sh to /container/run/startup/:cron
phpldapadmin_container | *** link /container/service/:cron/process.sh to /container/run/process/:cron/run
phpldapadmin_container | *** link /container/service/:logrotate/startup.sh to /container/run/startup/:logrotate
phpldapadmin_container | *** link /container/service/:php5-fpm/startup.sh to /container/run/startup/:php5-fpm
phpldapadmin_container | *** link /container/service/:php5-fpm/process.sh to /container/run/process/:php5-fpm/run
phpldapadmin_container | *** link /container/service/:syslog-ng-core/startup.sh to /container/run/startup/:syslog-ng-core
phpldapadmin_container | *** link /container/service/:syslog-ng-core/process.sh to /container/run/process/:syslog-ng-core/run
phpldapadmin_container | *** link /container/service/ldap-client/startup.sh to /container/run/startup/ldap-client
phpldapadmin_container | *** link /container/service/phpldapadmin/startup.sh to /container/run/startup/phpldapadmin
phpldapadmin_container | *** Set environment for startup files
phpldapadmin_container | *** Environment files will be proccessed in this order : 
phpldapadmin_container | Caution: previously defined variables will not be overriden.
phpldapadmin_container | /container/environment/99-default/default.yaml
phpldapadmin_container | 
phpldapadmin_container | To see how this files are processed and environment variables values,
phpldapadmin_container | run this container with '--loglevel debug'
phpldapadmin_container | *** Running /container/run/startup/:apache2...
phpldapadmin_container | *** Running /container/run/startup/:cfssl...
phpldapadmin_container | *** Running /container/run/startup/:cron...
phpldapadmin_container | *** Running /container/run/startup/:logrotate...
phpldapadmin_container | *** Running /container/run/startup/:php5-fpm...
phpldapadmin_container | *** Running /container/run/startup/:syslog-ng-core...
phpldapadmin_container | *** Running /container/run/startup/ldap-client...
phpldapadmin_container | No certificate file and certificate key provided, generate:
phpldapadmin_container | /container/service/ldap-client/assets/certs/ldap-client.crt and /container/service/ldap-client/assets/certs/ldap-client.key
phpldapadmin_container | 2016/06/07 10:35:23 [INFO] generate received request
phpldapadmin_container | 2016/06/07 10:35:23 [INFO] received CSR
phpldapadmin_container | 2016/06/07 10:35:23 [INFO] generating key: ecdsa-384
phpldapadmin_container | 2016/06/07 10:35:23 [INFO] encoded CSR
phpldapadmin_container | 2016/06/07 10:35:23 [INFO] signed certificate with serial number 561322734675630577092912973942148232864250094169
phpldapadmin_container | Link /container/service/:cfssl/assets/default-ca/default-ca.pem to /container/service/ldap-client/assets/certs/ldap-ca.crt
phpldapadmin_container | *** Running /container/run/startup/phpldapadmin...
phpldapadmin_container | Set apache2 http config...
phpldapadmin_container | *** Set environment for container process
phpldapadmin_container | *** Environment files will be proccessed in this order : 
phpldapadmin_container | Caution: previously defined variables will not be overriden.
phpldapadmin_container | /container/environment/99-default/default.yaml
phpldapadmin_container | 
phpldapadmin_container | To see how this files are processed and environment variables values,
phpldapadmin_container | run this container with '--loglevel debug'
phpldapadmin_container | *** Running runit daemon...
phpldapadmin_container | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message
phpldapadmin_container | Jun  7 10:35:24 d14a473aa845 syslog-ng[1475]: syslog-ng starting up; version='3.5.6'

however, once started and navigating to http://localhost:8092/, I see:

Parse error: syntax error, unexpected '}' in /container/service/phpldapadmin/assets/config.php on line 68

I checked the contents of the specific file:

docker exec phpldapadmin_container tail /container/service/phpldapadmin/assets/config.php 

/*********************************************
 * Define your LDAP servers in this section  *
 *********************************************/

$servers = new Datastore();

/*
 * Autogenerated servers variables will come here
 */
{{ PHPLDAPADMIN_SERVERS }}

The problematic line referred to is the last one. How can I fix it?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 17 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Still getting the same error here, with 0.6.11 and depends_on set:

compose.yml:

ldap:
    container_name: ldap
    image: 'osixia/openldap:1.1.6'
    environment:
      LDAP_ORGANISATION: 'xx'
      LDAP_DOMAIN: 'xx.com'
      LDAP_ADMIN_PASSWORD: 'admin'
    volumes:
      - /usr/local/ldapdata:/var/lib/ldap
      - /usr/local/ldapcfg:/etc/ldap/slapd.d

  ldap_admin:
    container_name: ldap_admin
    image: 'osixia/phpldapadmin:0.6.11'
    links:
      - ldap
    depends_on:
      - ldap
    environment:
      PHPLDAPADMIN_HTTPS: 'false'
      PHPLDAPADMIN_LDAP_HOSTS: 'ldap'
    ports:
      - '6080:80'
    command: '-l debug'

last bit of log:

ldap_admin        | *** Set environment for container process
ldap_admin        | *** Environment files will be proccessed in this order :
ldap_admin        | Caution: previously defined variables will not be overriden.
ldap_admin        | /container/environment/99-default/default.yaml
ldap_admin        |
ldap_admin        | *** --- process file : /container/environment/99-default/default.yaml ---
ldap_admin        | *** ignore : PHPLDAPADMIN_HTTPS = True (keep PHPLDAPADMIN_HTTPS = false )
ldap_admin        | *** Run commands before process...
ldap_admin        | *** ------------ Environment dump ------------
ldap_admin        | *** PHPLDAPADMIN_HTTPS = false
ldap_admin        | *** LC_CTYPE = C.UTF-8
ldap_admin        | *** PHPLDAPADMIN_SSL_HELPER_PREFIX = phpldapadmin
ldap_admin        | *** PHPLDAPADMIN_VERSION = 1.2.3
ldap_admin        | *** INITRD = no
ldap_admin        | *** HOME = /root
ldap_admin        | *** PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ldap_admin        | *** PHPLDAPADMIN_HTTPS_KEY_FILENAME = phpldapadmin.key
ldap_admin        | *** LANG = C.UTF-8
ldap_admin        | *** affinity:container = =64ecd3c116d91d415007c1a5f5662d221dedb783e3a12d6548a9322d886d8e71
ldap_admin        | *** PHPLDAPADMIN_SERVER_ADMIN = webmaster@example.org
ldap_admin        | *** CONTAINER_SERVICE_DIR = /container/service
ldap_admin        | *** PHPLDAPADMIN_HTTPS_CA_CRT_FILENAME = ca.crt
ldap_admin        | *** LANGUAGE = C.UTF-8
ldap_admin        | *** PHPLDAPADMIN_HTTPS_CRT_FILENAME = phpldapadmin.crt
ldap_admin        | *** PHPLDAPADMIN_TRUST_PROXY_SSL = False
ldap_admin        | *** PHPLDAPADMIN_LDAP_HOSTS = ldap
ldap_admin        | *** PHPLDAPADMIN_SHA1 = 669fca66c75e24137e106fdd02e3832f81146e23
ldap_admin        | *** CONTAINER_LOG_LEVEL = 4
ldap_admin        | *** HOSTNAME = 12bcc2afbc95
ldap_admin        | *** CONTAINER_STATE_DIR = /container/run/state
ldap_admin        | *** PHPLDAPADMIN_SERVER_PATH = /phpldapadmin
ldap_admin        | *** ------------------------------------------
ldap_admin        | *** Running runit daemon...
ldap_admin        | *** runit daemon started as PID 1431
ldap_admin        | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.6. Set the 'ServerName' directive globally to suppress this message

inside container the last bit of config.php still has templating intact:

/*********************************************
 * Define your LDAP servers in this section  *
 *********************************************/

$servers = new Datastore();

/*
 * Autogenerated servers variables will come here
 */
{{ PHPLDAPADMIN_SERVERS }}

Any ideas?

Any way I can add a startup delay to the admin container to make sure the ldap container has time to start up properly?