I would advise against it unless you really know what you are doing, as it opens too many security holes -- web browser, http connection, apache, php all see the user's passwords in plaintext before your php script checks it against the "crypt"-ed value of the password. Also databases are more complex and hence more prone to compromise than a locked shadow password file. Once your encrypted passwords are known you are stuffed.
But I have given it away anyway. Unix (& linux) passwords are encrypted using "crypt". Read php-manual:string-functions:crypt and the system manpage for crypt. To authenticate, crypt the password coming down the wire with the salt taken from the first two characters of the encrypted value. Then check the crypt'd value against the full stored value.
I should suggest the alternative that I use: insist the user uses a different password to their system one and store it as plain text (or md5 or whatever) in a database. Encourage people to think of web passwords as inherently insecure. Don't let them do anything dangerous (irreversible) via the web forms.
Of course, if you are using https and your system is otherwise watertight (apache up to date, php up to date, etc), it could be done safely.