Support » Fixing WordPress » Fatal error: Class 'PasswordHash' not found in functions.php

  • Resolved Angela

    (@angelazou)


    Hi, I need to store a lookup password on my site, so I used the WordPress hash to do it. However, it keeps saying that there the ‘Class ‘PasswordHash’ not found in functions.php’. Here is the snippet:

    $wp_hasher = new PasswordHash(8, TRUE);
    			if(!$wp_hasher->CheckPassword($password, $hash)) {
    				$error = "wrong password";
    			}

    I copied the example straight out of the codex, but I don’t know what’s missing (perhaps a include/require?)

Viewing 2 replies - 1 through 2 (of 2 total)
  • esmi

    (@esmi)

    Forum Moderator

    Try:

    $wp_hasher = new PasswordHash(8, TRUE);
    require_once( ABSPATH . 'wp-includes/class-phpass.php');
    if(!$wp_hasher->CheckPassword($password, $hash)) {
    	$error = "wrong password";
    }
    Angela

    (@angelazou)

    Got it, thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fatal error: Class 'PasswordHash' not found in functions.php’ is closed to new replies.