-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Implements extended error messages #1261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit introduces a new constant that can be used to retrieve more detailed error messages. This fixes #47222 The new constant LDAP_OPT_DIAGNOSTIC_MESSAGE is defined in PHP when the underlying library provides (and understands) it. This is the case in the current OpenLDAP-implementation. Tanks to Johnny Willer who provided the solution at http://stackoverflow.com/questions/28765077/get-number-of-ad-errors-with-ldap-and-php-ldap-function-return-unprecise-error/28816473#28816473
Merged |
Forgive the amateur question, is it possible to apply this patch without installing an entire new version of php? I am not ready to upgrade our current version of php until I'm certain that our code base will not break, but we need this particular functionality. |
You can cherry-pick it and rebuild PHP to try it if you want |
How would I go about doing that? My apologies for the daft question. Is there a website with instructions that I can read, or should I just google it? |
havent tested yet, but the patch only introduces the constant to php. When you know the value of the constant in OpenLDAP you can pass that instead of the constant using the ldap_set_option function. |
If I understand correctly, I can just paste the three lines of code into ldap.c, and then I would need to recompile the php project to rebuild it, correct? |
That should work. But you can also do the following without changing your PHP-Version: $extendedMessage = '';
ldap_get_option($ldapHandle, 0x0032, $extendedMessage); That's also described here: http://stackoverflow.com/questions/28765077/get-number-of-ad-errors-with-ldap-and-php-ldap-function-return-unprecise-error/28816473#28816473 |
Thanks, got it set up, I was able to diagnose the issue we were encountering and got it resolved. :) |
Great to hear! Anything we should know to improve the ldap-component furter? |
This is probably not directly related to the ldap-component, I'm not sure. Setting up PHP to accept ldaps connections is a pain. I have to convert the certificate to a different format, and then have PHP manually import the certificates when they're called. These are the instructions I had to use to get PHP to use ldaps: |
Ahh..... Well, no! The only part we can manage is the last line, so to say. The Nevertheless I'll see whether we can link to that "hot-to" in the documentation of the ldap-component. Thanks for sharing! |
This PR introduces a new constant that can be used to retrieve more detailed error messages.
This addresses https://bugs.php.net/bug.php?id=47222 and https://bugs.php.net/bug.php?id=38864
The new constant LDAP_OPT_DIAGNOSTIC_MESSAGE is defined in PHP when the underlying library provides (and understands) it. This is at least the case in the current OpenLDAP-implementation.
Thanks to Johnny Willer who provided the solution at http://stackoverflow.com/questions/28765077/get-number-of-ad-errors-with-ldap-and-php-ldap-function-return-unprecise-error/28816473#28816473