Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: simonleung on November 18, 2025, 03:31:13 AM

Title: PHP Error: Bind failed: Invalid credentials: LDAP_INVALID_CREDENTIALS
Post by: simonleung on November 18, 2025, 03:31:13 AM
I find the error message in the log file of Roundcube as follows. What is about? How do I solve it?


[18-Nov-2025 16:30:04 Asia/Hong_Kong] PHP Deprecated:  Return type of Net_LDAP2_Search::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/roundcube/vendor/pear/net_ldap2/Net/LDAP2/Search.php on line 565
[18-Nov-2025 16:30:04 Asia/Hong_Kong] PHP Deprecated:  Return type of Net_LDAP2_Search::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/roundcube/vendor/pear/net_ldap2/Net/LDAP2/Search.php on line 596
[18-Nov-2025 16:30:04 Asia/Hong_Kong] PHP Deprecated:  Return type of Net_LDAP2_Search::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/roundcube/vendor/pear/net_ldap2/Net/LDAP2/Search.php on line 581
[18-Nov-2025 16:30:04 Asia/Hong_Kong] PHP Deprecated:  Return type of Net_LDAP2_Search::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/roundcube/vendor/pear/net_ldap2/Net/LDAP2/Search.php on line 619
[18-Nov-2025 16:30:04 Asia/Hong_Kong] PHP Deprecated:  Return type of Net_LDAP2_Search::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/roundcube/vendor/pear/net_ldap2/Net/LDAP2/Search.php on line 632
[18-Nov-2025 16:30:04 +0800]: <ro5hei66> PHP Error: Bind failed: Invalid credentials: LDAP_INVALID_CREDENTIALS (POST /?_task=settings&_action=plugin.password-save)
[18-Nov-2025 16:30:04 Asia/Hong_Kong] PHP Fatal error:  Uncaught TypeError: ldap_close(): Argument #1 ($ldap) must be of type LDAP\Connection, false given in /var/www/roundcube/vendor/pear/net_ldap2/Net/LDAP2.php:701
Stack trace:
#0 /var/www/roundcube/vendor/pear/net_ldap2/Net/LDAP2.php(701): ldap_close()
#1 /var/www/roundcube/vendor/pear/pear-core-minimal/src/PEAR.php(814): Net_LDAP2->_Net_LDAP2()
#2 [internal function]: _PEAR_call_destructors()
#3 {main}
  thrown in /var/www/roundcube/vendor/pear/net_ldap2/Net/LDAP2.php on line 701


Title: Re: PHP Error: Bind failed: Invalid credentials: LDAP_INVALID_CREDENTIALS
Post by: SKaero on November 18, 2025, 10:18:37 AM
I'm not an expert with ldap but the error means what it says it can't connect to the server the credentials are invalid. I'd recommend double checking what you have set in the config file and you could try looking at the ldap server logs to see if they give you any other information.
Title: Re: PHP Error: Bind failed: Invalid credentials: LDAP_INVALID_CREDENTIALS
Post by: alec on November 21, 2025, 02:12:52 AM
The fatal error is Net_LDAP2 issue. https://github.com/pear/Net_LDAP2/issues/15.
Title: Re: PHP Error: Bind failed: Invalid credentials: LDAP_INVALID_CREDENTIALS
Post by: alec on November 21, 2025, 02:35:14 AM
I suggest to try the ldap_simple driver instead of ldap for the password plugin.
Title: Re: PHP Error: Bind failed: Invalid credentials: LDAP_INVALID_CREDENTIALS
Post by: alec on November 21, 2025, 03:07:00 AM
A fix for Roundcube master (which supports PHP >= 8.1) might be to remove all ->done() calls from the 'ldap' driver code, but I can't test it.