title: PHP cannot find anything in LDAP (while python can)
body: <p>Help me,please. I have some problems with my php code, while trying to search user in ldap.
  On the same VM I execute python code without problems, searching for user completes successfully. Obvious, it isn't network connection problems.
  LDAP filter is the same in php and in python code. </p>
  
  <p>Also I noticed that when I look in output of tcpdump, executed in the same time as my php code, I see that count of packets is much less, then when I execute tcpdump in parallel with python code (7 packets while executing php vs 729 packs while executing python code)</p>
  
  <p><strong>php code</strong>:</p>
  
  <pre><code>&lt;?php
  $ldapConnectionId = ldap_connect("domain.controller.example");
  $LDAP_USER='domain\username';
  $LDAP_PSWD='userpass';
  $ldaptree = 'DC=X,DC=X,DC=X';
  ldap_set_option($ldapConnectionId, LDAP_OPT_PROTOCOL_VERSION, 3);
  ldap_set_option($ldapConnectionId, LDAP_OPT_REFERRALS, false);
  
  $bnd = ldap_bind($ldapConnectionId, $LDAP_USER, $LDAP_PSWD);
  $filter='(&amp;(objectClass=user)(objectCategory=person))';
  $ldapSearchResults = ldap_search($ldapConnectionId, $ldaptree, $filter);
  $ldapEntries = ldap_get_entries($ldapConnectionId, $ldapSearchResults);
  echo $ldapEntries["count"]." entries found\n";
  ldap_close($ldapConnectionId);
  ?&gt;
  </code></pre>
  
  <p><strong>python code</strong>, that works properly on the same VM:</p>
  
  <pre><code>AD_SERVER='domain.controller.example'
  AD_USER='domain\username'
  AD_PASS='userpass'
  server=Server(AD_SERVER,get_info=ALL)
  conn = Connection(server,user=AD_USER,password=AD_PASS, auto_bind=True)
  conn.start_tls()
  conn.search(search_base='dc=X,dc=X,dc=X',
  search_filter='(&amp;(objectClass=user)(objectCategory=person))',
  attributes=['distinguishedName'])
  </code></pre>
  
  <p>After executing this code (php7.3 as interpreter), I get  "0 entries found"
  What may be the problem?</p>
  
  <p>Thanks!</p>