the ugly chpaswd method use the python script, and some server does not use the required python or does not use python in environment...
so pam must be a valid solution due some hosting provides a pam sincronization.
for use pam, must use the php-auth-pam sources and made setuid the module