Call to undefined function pam_auth

Call to undefined function pam_auth

by Adam Morris -
Number of replies: 1

This is more of a sysadmin question. I'd like to use the PAM authentication method and when I turned it on I got this message:

PHP message: PHP Fatal error:  Call to undefined function pam_auth()

I'm using Ubuntu 12 and apt-get install php5-auth-pam reports no installation candidate.

Average of ratings: -
In reply to Adam Morris

Re: Call to undefined function pam_auth

by Brad Smith -

Just in case anyone else runs into this, the solution is in /usr/share/doc/php5-auth-pam/FAQ.gz  (you can view it by running zcat /usr/share/doc/php5-auth-pam/FAQ.gz | less). 

Basically, you have to make it so the web server's user (www-data) can read /etc/shadow. The easiest way to do this is:

  1. Open /etc/group in a text editor (you will need sudo/root privs)
  2. Find the line that begins www-data
  3. Add www-data to the end of that line (after that last colon) 
  4. Restart apache: service apache2 restart