Here is some great information from the OpenLDAP FAQs regarding changing a userPassword attribute with PHP:
http://www.openldap.org/faq/data/cache/347.html
$userpassword = "{SHA}" . base64_encode( pack( "H*", sha1( $pass ) ) );