As john.hallam@compaq.com above mentioned ,one has to set option LDAP_OPT_PROTOCOL_VERSION=3
ldap_set_option($ds,LDAP_OPT_PROTOCOL_VERSION,3);
to use the ldap_rename function.
However, the ldap_set_option() line has to be written immediately after ldap_connect() and before ldap_bind() statements.
Christos Soulios