ldap_bind(): Unable to bind to server: Can't contact LDAP server #5208

Closed
opened 2026-02-05 09:48:35 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @MikeBravoo on GitHub (Mar 6, 2025).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Hi,
I am a newbie in LDAP setup and configuration. I'm using Windows Active Directory and trying to setup LDAP authentication but I'm facing this error:
ErrorException: ldap_bind(): Unable to bind to server: Can't contact LDAP server

LDAP configuration:
`### LDAP Configuration ###
AUTH_METHOD=ldap
LDAP_SERVER=domain_controller_host:389
LDAP_BASE_DN="dc=DOMAIN,dc=LOCAL"
LDAP_DN="cn=BOOKSTACK_SERVICE_ACCOUNT,ou=USER_GROUP,dc=DOMAIN,dc=LOCAL"
LDAP_PASS="PASSWORD"
LDAP_VERSION=3
LDAP_START_TLS=false

LDAP_ID_ATTRIBUTE=uid
LDAP_EMAIL_ATTRIBUTE=mail
LDAP_DISPLAY_NAME_ATTRIBUTE=cn
LDAP_USER_FILTER="(&(sAMAccountName=${user}))"`

Error code attached. Kindly advise.

Exact BookStack Version

25.02

Log Content

error_log.log

Hosting Environment

PHP 8.2.25, on Rocky Linux version 9.5

Originally created by @MikeBravoo on GitHub (Mar 6, 2025). ### Attempted Debugging - [x] I have read the debugging page ### Searched GitHub Issues - [x] I have searched GitHub for the issue. ### Describe the Scenario Hi, I am a newbie in LDAP setup and configuration. I'm using Windows Active Directory and trying to setup LDAP authentication but I'm facing this error: ErrorException: ldap_bind(): Unable to bind to server: Can't contact LDAP server LDAP configuration: `### LDAP Configuration ### AUTH_METHOD=ldap LDAP_SERVER=domain_controller_host:389 LDAP_BASE_DN="dc=DOMAIN,dc=LOCAL" LDAP_DN="cn=BOOKSTACK_SERVICE_ACCOUNT,ou=USER_GROUP,dc=DOMAIN,dc=LOCAL" LDAP_PASS="PASSWORD" LDAP_VERSION=3 LDAP_START_TLS=false LDAP_ID_ATTRIBUTE=uid LDAP_EMAIL_ATTRIBUTE=mail LDAP_DISPLAY_NAME_ATTRIBUTE=cn LDAP_USER_FILTER="(&(sAMAccountName=${user}))"` Error code attached. Kindly advise. ### Exact BookStack Version 25.02 ### Log Content [error_log.log](https://github.com/user-attachments/files/19113125/error_log.log) ### Hosting Environment PHP 8.2.25, on Rocky Linux version 9.5
OVERLORD added the 🐕 Support label 2026-02-05 09:48:35 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Mar 7, 2025):

Hi @MikeBravoo,

Have you confirmed in any way that the BookStack host has network visibility of the configured LDAP server?
The error observed could occur if there were basic connectivity issues (firewall rules blocking, no network route etc...).

@ssddanbrown commented on GitHub (Mar 7, 2025): Hi @MikeBravoo, Have you confirmed in any way that the BookStack host has network visibility of the configured LDAP server? The error observed could occur if there were basic connectivity issues (firewall rules blocking, no network route etc...).
Author
Owner

@MikeBravoo commented on GitHub (Mar 7, 2025):

Hi @MikeBravoo,

Have you confirmed in any way that the BookStack host has network visibility of the configured LDAP server?
The error observed could occur if there were basic connectivity issues (firewall rules blocking, no network route etc...).

Hi @ssddanbrown ,

I tried pinging the Domain Controller using it's hostname but no luck. However pinging the IP was a success.
I did allow the firewall using this command:

sudo firewall-cmd --add-service=http

@MikeBravoo commented on GitHub (Mar 7, 2025): > Hi @MikeBravoo, > > Have you confirmed in any way that the BookStack host has network visibility of the configured LDAP server? > The error observed could occur if there were basic connectivity issues (firewall rules blocking, no network route etc...). Hi @ssddanbrown , I tried pinging the Domain Controller using it's hostname but no luck. However pinging the IP was a success. I did allow the firewall using this command: sudo firewall-cmd --add-service=http
Author
Owner

@MikeBravoo commented on GitHub (Mar 16, 2025):

Issue solved. SELinux was causing this issue.
I disabled SELinux and logged in Bookstack sucessfully!

Thanks @ssddanbrown for your help

@MikeBravoo commented on GitHub (Mar 16, 2025): Issue solved. SELinux was causing this issue. I disabled SELinux and logged in Bookstack sucessfully! Thanks @ssddanbrown for your help
Author
Owner

@ssddanbrown commented on GitHub (Mar 16, 2025):

Glad to hear you found the cause and solved this @MikeBravoo !

I'll therefore close this off.

@ssddanbrown commented on GitHub (Mar 16, 2025): Glad to hear you found the cause and solved this @MikeBravoo ! I'll therefore close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5208