If your system is using LDAP, you can use the LDAP functions.
By default linux systems tend to use pam for authentication. A quick google search turns up the php4 pam authentication module. I've never used it but it looks promising.
You could, in theory, read the passwords directly from the shadow file (you are using shadow passwords, right?), but giving php read access to that would be a security risk, so definitely not recommended.