7

I have PHP 5.5.6 on my XAMPP and I didn't encounter the error. But after uploading my website to our testing environment the following error occurred:

PHP Fatal Error: Call to undefined function password_verify()

Our testing envt/server has PHP 5.5.9 (I checked it using command php -v)

I also checked the PHP manual and it says nothing to configure and nothing to install when using this functions. Any ideas what might be causing this issue?

4
  • 3
    @Tommy, It is a PHP built in function as of 5.5 Commented Feb 14, 2014 at 9:53
  • i checked my php version using php -v and it says: PHP 5.5.9 (cli) (built: blah blah) Commented Feb 14, 2014 at 9:57
  • 1
    CLI is not the same SAPI as webserver. Upload a file with phpinfo() to check what the webserver is running Commented Feb 14, 2014 at 10:00
  • I must say, as simple as this problem seems to be, it took me quite a while to realize this... Commented Aug 4, 2014 at 20:08

2 Answers 2

13

password_verify() is built in since PHP 5.5.0 and it's most likely that your server doesn't run the latest PHP version. Be sure to double check the PHP version on your server either via phpinfo() or phpversion().

Please note that your CLI and mod_php (or php-fpm) versions might differ, executing php -v might give you a wrong version number. Create a PHP file and open it with your browser to be absolutely sure.

The reason for the differing versions of the CLI, mod_php and php-fpm are related to the packages which are offered by the operating system and what the actual administrator installed on the system. Personally I prefer to compile PHP on my own and be sure to get best performance but also the same version across the complete system.

Sign up to request clarification or add additional context in comments.

7 Comments

i had checked it, using php -v and it says PHP 5.5.9
that's odd, php -v says its 5.5.9, and phpversion() says 5.3.3. thank you Fleshgrinder
It's because they are different installations. If it's your server simply update all PHP packages and your mod_php if you're using Apache httpd. If it's a hosting, well I guess you're out of luck.
Definitely another question and relies on your operating system, PHP via mod_php or php-fpm, do you have SSH access or is your hosting managed? Create a new question containing as many information about your server environment as possible and you'll get an answer right away.
Well, show them that they're wrong and tell them to update the PHP web server SAPI.
|
4

Replacement for PHP versions lower than 5.5

https://github.com/superandrew/phpPasswordHashingLib

1 Comment

moved server and didnt bother going to the effort of installing a non repo version of php...major oversight. This worked perfectly though, thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.