tobybatch / kimai2

Docker containers for the kimai2 web application including docker-compose and kubernetes/helm deployment.
MIT License
181 stars 96 forks source link

[BUG] Unable to load dynamic library 'ldap.so' #67

Closed vvirehead closed 4 years ago

vvirehead commented 4 years ago

Describe the bug Clean installation reports LDAP missing:

kimai_1    | PHP Warning:  PHP Startup: Unable to load dynamic library 'ldap.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20180731/ldap.so (Error loading shared library libldap-2.4.so.2: No such file or directory (needed by /usr/local/lib/php/extensions/no-debug-non-zts-20180731/ldap.so)), /usr/local/lib/php/extensions/no-debug-non-zts-20180731/ldap.so.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20180731/ldap.so.so: No such file or directory)) in Unknown on line 0

To Reproduce Steps to reproduce the behaviour:

  1. pull the repo
  2. run docker-compose up
  3. observe error in console

Desktop (please complete the following information):

Command used to run the container

Docker compose file (with passwords redacted)

services:

  sqldb:
    image: mysql:5.7
    environment:
      - MYSQL_DATABASE=kimai
      - MYSQL_USER=kimaiuser
      - MYSQL_PASSWORD=kimaipassword
      - MYSQL_ROOT_PASSWORD=####
    volumes:
      - /var/lib/mysql
    command: --default-storage-engine innodb
    restart: unless-stopped
    healthcheck:
      test: mysqladmin -p#### -h localhost
      interval: 20s
      start_period: 10s
      timeout: 10s
      retries: 3
    networks:
      - kimai

  nginx:
    build: compose
    ports:
      - ####:80
    volumes:
      - ./nginx_site.conf:/etc/nginx/conf.d/default.conf
    restart: unless-stopped
    depends_on:
      - kimai
    volumes:
      - public:/opt/kimai/public
    healthcheck:
      test:  wget --spider http://nginx/health || exit 1 
      interval: 20s
      start_period: 10s
      timeout: 10s
      retries: 3
    networks:
      - kimai

  kimai:
    image: kimai/kimai2:fpm-alpine-1.5-prod
    environment:
      - APP_ENV=prod
      - TRUSTED_PROXIES=localhost
      - TRUSTED_HOSTS=kimai.example.net
      - ADMINMAIL=admin@kimai.local
      - ADMINPASS=####
    volumes:
      #- ./opt/kimai:/opt/kimai
      - public:/opt/kimai/public
      - var:/opt/kimai/var
    restart: unless-stopped
    healthcheck:
      test: wget --spider http://nginx || exit 1
      interval: 20s
      start_period: 10s
      timeout: 10s
      retries: 3
    networks:
      - kimai

  postfix:
    image: catatnight/postfix
    environment:
      maildomain: neontribe.co.uk
      smtp_user: kimai:kimai
    restart: unless-stopped
    restart: always
    networks:
      - kimai

networks:
  kimai:
    name: kimai
    driver: bridge
    driver_opts:
      com.docker.network.bridge.name: br-kimai

volumes:
  public:
  var:

Additional context I've read the https://www.kimai.org/documentation/ldap.html, and also tried to modify dockerfile (prod section at the bottom) - with same error output:


    composer install --working-dir=/opt/kimai --no-dev --optimize-autoloader && \
    composer clearcache && \
    composer require --working-dir=/opt/kimai laminas/laminas-ldap && \
    chown -R www-data:www-data /opt/kimai
USER www-data```

replaced laminas with `composer require zendframework/zend-ldap` in configurations with --working-dir and without.
urinal-cake commented 4 years ago

Getting this as well in my logs. OS: Ubuntu 18.0.4 Docker version: 19.03.5 Docker compose version: 1.17.1

tobybatch commented 4 years ago

@urinal-cake @g-mike This is fixed in the latest builds. I have checked for sure in the 1.7 image.

vvirehead commented 4 years ago

@urinal-cake @g-mike This is fixed in the latest builds. I have checked for sure in the 1.7 image.

Error is gone from the logs now, thanks!