Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Call to undefined function password_verify() auth_helper.php on line 2 #2

Closed
ceceps opened this issue Dec 10, 2014 · 1 comment

Comments

@ceceps
Copy link

ceceps commented Dec 10, 2014

Got error like this after successfull login on backend
password_verify() on ci_bootstrap\applications\backend\helpers\auth_helper.php on line 26

@ceceps ceceps changed the title Fatal error: Call to undefined function password_verify() in \ci_bootstrap\applications\backend\helpers\auth_helper.php on line 26 Fatal error: Call to undefined function password_verify() auth_helper.php on line 2 Dec 10, 2014
@waifung0207
Copy link
Owner

Hi,

The function password_verify() is come from native PHP but only after version 5.5 as indicated here:
http://php.net/manual/en/function.password-verify.php

So you will need to upgrade PHP version server to enable this function, as well as another function password_hash().

Alternatively, you can change the source code from file "helpers/auth_helper.php" (from both frontend and backend sites) as below.

function hash_pw($plain_pw)
{
    // (optional) change logic here for different hash algorithm
    //return password_hash($plain_pw, PASSWORD_DEFAULT);
    return md5($plain_pw);
}

function verify_pw($plain_pw, $hashed_pw)
{
    // (optional) change logic here for different hash algorithm
    //return password_verify($plain_pw, $hashed_pw);
    return (md5($plain_pw)==$hashed_pw);
}

For sure md5 is not secure enough but this just shows an example about how you can change the hashing logic with your own code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants