Mediawiki Docker: How to find PHP & enable LDAP?

I have set up a MediaWiki container which uses a MySQL container for its database. I’m attempting to set up LDAP authentication (https://www.mediawiki.org/wiki/Extension:LDAPAuthentication2). I am able to get the prerequisites LDAPProvider and PluggableAuth installed and verified on the Special:Version page, but as soon as I try to enable LDAPAuthentication2 the page bombs out. I figured out that I needed to either configure a json file (which I did not do) or enter $LDAPProviderDomainConfigProvider in my LocalSettings.php (which I did). Now I’m getting the error “Call to undefined function ldap_connect()”. I googled and it seems that the LDAP stack is not installed with PHP by default, and you need to edit PHP.ini to include “–with-ldap[=DIR]”. Firstly, I’m not entirely sure what directory I need to enter, but more importantly I cannot seem to find a PHP.ini anywhere in the Wediawiki Docker container.

Where do I need to go in order to modify PHP to enable LDAP, or do I actually need to install the PHP LDAP module into the container to get this to work?

Hi

Which image are you using? if your own, please provide the Dockerfile.
If you’re using your own, and using PHP as a base image, you can checkout:
https://hub.docker.com/_/php “How to install more PHP extensions”

Else yea … provide Dockerfile :slight_smile:

Thanks for the reply. I’m using the base Mediawiki container and docker run command:

docker run -d --name redmine \
  --link mysql \
  -e REDMINE_DB_MYSQL=mysql \
  -e REDMINE_DB_PASSWORD=[generated sql root pw] \
  -p 80:3000 \
  -p 443:443 \
  redmine

I am running this on a PhotonOS VM and also have a MySQL container (linked) and an Adminer container (should be unrelated, but it’s there).

Just a quick bump to see if anyone has any suggestions for how I might proceed. I just need to enable LDAP in my PHP, but I’m not sure whether I need to find PHP or install PHP, and not sure if that’s something you do in a docker run command or if I need to branch the project and get messy.