To follow referrals in PHP, you have to explicitly tell PHP that you want the LDAP server to return the referral to you. In PHP, the default is for the PHP LDAP library to tell the LDAP server not to follow referrals. In PHP, not only do you have to set the referral option, but you also have to explicitly set the LDAP v3 protocol. Below is an example of how to have PHP tell the LDAP server that referrals should be returned:
Please see the following reference for more information: ldap_set_option.