title: PHP/PAM to change user password?
body: <p>Are there any working packages to change a linux user passwords using PHP?</p>
  
  <p>I've tried using PECL:PAM but theres an error when it tries to change the password.</p>
  
  <p>Edit:</p>
  
  <p>PHP code: </p>
  
  <pre><code>echo pam_chpass($username, $password, $new_pass, &amp;$error) ? 'good' : $error;
  </code></pre>
  
  <p>PHP (echo) output: </p>
  
  <pre><code>Permission denied (in pam_authenticate)
  </code></pre>
  
  <p>From /var/log/auth (these are actually from before, the log doesn't seem to be working ATM for some reason yet to be determined):</p>
  
  <pre><code>Jun 11 15:30:20 veda php: pam_unix(php:chauthtok): conversation failed
  Jun 11 15:30:20 veda php: pam_unix(php:chauthtok): password - (old) token not obtained
  Jun 11 15:30:20 veda php: pam_winbind(php:chauthtok): valid_user: wbcGetpwnam gave WBC_ERR_DOMAIN_NOT_FOUND
  </code></pre>
  
  <p>Other:</p>
  
  <p>Sorry for the lack of details before, I was really tired when I posted the question but thats still a crappy excuse.</p>