2 comparable hashes generated from one string
Deriving an encryption key and a password hash from a single password
Hash the password, along with a per-account salt.
hash1 = SHA256(password, salt)

hash1 is your encryption passphrase that you pass to GPG.
hash2 = SHA256(hash1)

You keep hash2 in your database to figure out when a user has logged in correctly.
(For additional security, change the first SHA256 out for scrypt, tuned for 50 milliseconds. More trouble than it's worth, IMO.)
Encrypting a file
Use a library like GnuPG. If you don't have GnuPG bindings for your language (I'm guessing you're using PHP), you can hack something together by running gpg from your program with the  -c and --passphrase arguments.
Note that if the user changes their password, you need to decrypt and re-encrypt using the new password.