When setting a new Rdn value be sure to escape any commas that are not path designators. I spent several hours trying to move user nodes in AD since their cn was set wrong. We wanted the cn to be set to: lastname, firstname.
<?php
//In this example we are renaming a node with cn of "jsmith" to "Smith, John"
/*
Setting some variables to values for display purposes.
In a real script the values would probably come from some outside source (file, ldap query, etc...)
*/
$dn = 'cn=jsmith,ou=mygroup,dc=mydomain';
$name = "Smith, John";
// Now replace those pesky commas
$newRdn = "cn=" . str_replace(",", "\\,", $name);
ldap_rename($link, $dn, $newRdn, $newParent, true);
?>