Title: Plugin 500 Error
Last modified: April 3, 2019

---

# Plugin 500 Error

 *  [mikec55555](https://wordpress.org/support/users/mikec55555/)
 * (@mikec55555)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/plugin-500-error/)
 * Hello,
 * I installed a fresh copy of this plugin wita week ago on a WordPress 4.x site
   and it worked fine. I tried again today with a fresh copy of the plugin and it
   produced a 500 error.
 * Am I using the plugin wrong?
 * Here are the errors in Apache’s log:
 * [Wed Apr 03 16:07:57.978727 2019] [:error] [pid 32220] [client 108.162.53.11:
   17150] PHP Fatal error: Call to undefined function ldap_escape() in /var/www/
   vhosts/teststaging-wordpress.trdev.site/web/content/wp-content/plugins/authldap/
   authLdap.php on line 517, referer: [https://teststaging-wordpress.our.site/wp-login.php](https://teststaging-wordpress.our.site/wp-login.php)
   [
   Wed Apr 03 16:08:49.378441 2019] [:error] [pid 32220] [client 108.162.53.11:34366]
   PHP Fatal error: Call to undefined function ldap_escape() in /var/www/vhosts/
   teststaging-wordpress.trdev.site/web/content/wp-content/plugins/authldap/authLdap.
   php on line 517, referer: [https://teststaging-wordpress.our.site/wp-login.php?loggedout=true](https://teststaging-wordpress.our.site/wp-login.php?loggedout=true)
 * (Domain name of referrer changed : ) )
 * So, I compared the two different plugin copies and found a few changes from last
   week – newer is on the right:
 * diff -r authldap /var/www/vhosts/teststaging-wordpress.trdev.site/web/authldap
   
   diff -r authldap/authLdap.php /var/www/vhosts/teststaging-wordpress.trdev.site/
   web/authldap/authLdap.php 6c6 < Version: 2.1.0 — > Version: 2.1.1 515c515,519
   < $authLDAPGroupFilter = str_replace(‘%dn%’, $dn, $authLDAPGroupFilter); — > 
   $authLDAPGroupFilter = str_replace( > ‘%dn%’, > ldap_escape($dn, ”, LDAP_ESCAPE_FILTER),
   > $authLDAPGroupFilter > ); 518c522,526 < $groups = authLdap_get_server()->search(
   sprintf($authLDAPGroupFilter, $username), array($authLDAPGroupAttr), $authLDAPGroupBase);—
   > $groups = authLdap_get_server()->search( > sprintf($authLDAPGroupFilter, ldap_escape(
   $username, ”, LDAP_ESCAPE_FILTER)), > array($authLDAPGroupAttr), > $authLDAPGroupBase
   > ); diff -r authldap/readme.txt /var/www/vhosts/teststaging-wordpress.trdev.
   site/web/authldap/readme.txt 42a43,45 > = 2.1.1 = > * Add escaping filter-values.
   That should help filtering for groups where the DN might contain braces or spaces
   >

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [heiglandreas](https://wordpress.org/support/users/heiglandreas/)
 * (@heiglandreas)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/plugin-500-error/#post-11388836)
 * You are most probably using an outdated PHP-version as the ldap_escape function
   is only available from PHP5.6 on. That’s why the plugin version 2.1.1 requires
   at least PHP5.6 as noted in the readme.txt – Though I’ve just noticed that the
   plugin page still states PHP5.4 as the min version.
 * Thanks for bringing that to my aftention. I see to fix that ASAP.
 * So for you the tso options are either to upgrade your PHP to a supported version(
   7.1 or higher – highly recommended!) or use an older version of the plugin.
 *  Thread Starter [mikec55555](https://wordpress.org/support/users/mikec55555/)
 * (@mikec55555)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/plugin-500-error/#post-11388974)
 * Thank you! Do you have a version of the plugin that supports PHP 5.3? We have
   quite a few older sites we need to retire soon.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Plugin 500 Error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/authldap.svg)
 * [authLdap](https://wordpress.org/plugins/authldap/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/authldap/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/authldap/)
 * [Active Topics](https://wordpress.org/support/plugin/authldap/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/authldap/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/authldap/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [mikec55555](https://wordpress.org/support/users/mikec55555/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/plugin-500-error/#post-11388974)
 * Status: not resolved