Search code examples
ldapddev

How can I install php7.3-ldap on DDEV?


I'm trying to install the LDAP extension in my DDEV web container on macOS 10.15.4 with Docker 19.03.8. But the install step seems to be hanging endlessly. (Like half an hour before I quit it.)

First, I initiated DDEV.

ddev config --project-type drupal8 --docroot www/web

Then I added the post start hooks below.

name: foobar
type: drupal8
docroot: www/web
php_version: "7.3"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
provider: default
use_dns_when_possible: true

hooks:
  post-start:
    - exec: "sudo apt-get update"
    - exec: "sudo apt-get install -y php7.3-ldap"

And run ddev start. But then it hangs at the install step.

=== Running task: Exec command 'sudo apt-get install -y php7.3-ldap' in container/service 'web', output below debconf: delaying package configuration, since apt-utils is not installed

Is this how LDAP is supposed to be added? Or could that be a bug?

Side note: When I sudo apt-get install -y php-ldap it actually works, but this installs me the PHP 7.4 lib. I need to PHP 7.3 lib.


Solution

  • Edit 2020-08-02: In ddev v1.15+, php7.3-ldap is already installed, so this question is moot. But ldap was previously a good example of using webimage_extra_packages as described below.

    In ddev v1.14+, just add webimage_extra_packages: [php7.3-ldap] to your .ddev/config.yaml. Adding php7.3-yaml is actually the example given for this in the docs on webimage_extra_packages.