Hi has anyone seen an error like this before I believe it has to do with logging into a page using domain credentials but our logins have been converted to exchange online (PHP Fatal error: Uncaught TypeError: ldap_get_dn(): Argument #2 ($entry) must be of type LDAP\ResultEntry, bool given in /var/www/html/folder/external/ldap.php:26\nStack trace:\n#0 /var/www/html/folder/external/ldap.php(26): ldap_get_dn()\n#1 /var/www/html/folder/login.php(141): _ldap_login()\n#2 {main}\n thrown in /var/www/html/folder/external/ldap.php on line 26,)
nander
15
Newbie Poster
Recommended Answers
Jump to PostIt sounds like the $entry variable that was passed in as the second parameter of the ldap_get_dn() function in ldap.php is most likely FALSE. This typically happens when the function that was used to populate $entry failed and returned false.
Jump to PostYes, I understand that’s what’s failing, but it’s the second parameter being passed into that function. I can’t help unless I see the complete ldap.php file.
Jump to PostWhen you removed the comment on the line
//echo "<br /><br />OU= $data<br /><br />";
What did it say the value of $data is?
If it doesn’t show anything, try
var_dump($data);
All 9 Replies
Dani
4,084
The Queen of DaniWeb
Administrator
Featured Poster
Premium Member
nander
commented:
Thanks for responding! So here is lines 25 and 26 the $first entry is failing $first = ldap_first_entry($ldap, $res); $data = ldap_get_dn($ldap, $fi
+0
Dani
4,084
The Queen of DaniWeb
Administrator
Featured Poster
Premium Member
nander
15
Newbie Poster
Dani
4,084
The Queen of DaniWeb
Administrator
Featured Poster
Premium Member
nander
commented:
Here is the value $first = ldap_first_entry($ldap, $res);
+0
nander
15
Newbie Poster
Dani
4,084
The Queen of DaniWeb
Administrator
Featured Poster
Premium Member
nander
15
Newbie Poster
Dani
4,084
The Queen of DaniWeb
Administrator
Featured Poster
Premium Member
nander
15
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.