Closed hekler91 closed 2 years ago
Hi @hekler91,
This means that your PHP installation in the docker container does not have the LDAP extension enabled. Make sure it's enabled, and this error will go away.
Hi Steve I think I activated it in Docker. This is my Dockerfile:
FROM php:8.0.2-fpm-alpine
COPY . /usr/src/enterprise-service-bus
WORKDIR /usr/src/enterprise-service-bus
#RUN pecl install apc
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/bin/
# Install PHP extensions
RUN install-php-extensions ldap
RUN docker-php-ext-enable ldap
This is the message I am getting : ldap (ldap) is already loaded!
Hi @hekler91,
I’m 100% confident that the error message you’re seeing is due to the extension not being enabled. I would check to make sure that you’re issuing the command on the proper docker container against a PHP version with the LDAP extension enabled.
Try running the below command on your container to make sure it’s enabled:
php -r "print_r(get_loaded_extensions());”
I solved it, thank you very much for the support.
Excellent, happy to help @hekler91! Im glad you were able to resolve it.
Hello
I'm trying to run my LDAP Command on Docker, unfortunately I get this error:
Use of undefined constant LDAP_ESCAPE_FILTER - assumed 'LDAP_ESCAPE_FILTER' (this will throw an Error in a future version of PHP)
at vendor/directorytree/ldaprecord/src/Models/Attributes/EscapedValue.php:117 113▕ @return $this 114▕ / 115▕ public function both() 116▕ { ➜ 117▕ $this->flags = LDAP_ESCAPE_FILTER + LDAP_ESCAPE_DN; 118▕ 119▕ return $this; 120▕ } 121▕ }
vendor frames app/Console/Commands/SyncLdap.php:21 LdapRecord\Models\Model::all() vendor frames 22 artisan:37
I put the following in the Docker file:
FROM php:7.4-cli
COPY . /usr/src/enterprise-service-bus
WORKDIR /usr/src/enterprise-service-bus
Configure LDAP.
FROM php:7.4.9-fpm-alpine3.12
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/bin/
Install PHP extensions
RUN install-php-extensions ldap and then started the installation with 'docker build -t getting-started.
Do I need to configure anything else for LDAP and how to solve this problem?
Thanks to everyone for their help.
Environment: