Title: LDAP stops working after updating PHP from 8.2.12 to 8.2.35 – SASL DLL version mismatch #57
stoelli59
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Environment
Windows 11
most actual XAMPP (still 8.2.12) with PHP 8.2.12, subsequently updated to PHP 8.2.35
The same problem also occurred with PHP 8.4.27
Problem
After manually replacing the PHP directory in XAMPP with a newer PHP version, ldap_connect() failed. The PHP LDAP extension was enabled, but LDAP operations produced these errors:
With ldaps://: Could not create new security context
With ldap://: Could not create session handle: Local error
The Apache error log revealed the actual cause:
ldap_int_sasl_init: SASL library version mismatch: expected 2.1.28, got 2.1.27
Cause and solution
Two different versions of libsasl.dll were present:
C:\xampp\apache\bin\libsasl.dll – older version, dated October 2023
C:\xampp\php\libsasl.dll – newer version, dated October 2026
The new PHP LDAP extension expected Cyrus SASL 2.1.28, but Apache loaded the older SASL library (2.1.27).
Renaming the old DLL caused PHP's LDAP extension to fail to load. Copying the newer libsasl.dll from C:\xampp\php to C:\xampp\apache\bin fixed the problem. LDAP authentication then worked again without any changes to the PHP code or LDAP server configuration.
Conclusion
When manually updating PHP in XAMPP on Windows, check for DLL version mismatches between C:\xampp\php and C:\xampp\apache\bin. The error message in the Apache log was the key to identifying the problem.
It may be worth checking whether the PHP update instructions should mention this potential DLL dependency issue.
All reactions