PHP password_hash() and password_verify() functions work on localhost, but not on my server.
Hi everyone, this might be a problem specific to me,but I can't for the life of me figure out why it's happening. I tried running this simple php script:
<?php
echo password_hash("rasmuslerdorf", PASSWORD_DEFAULT);
?>
On my localhost, this code works perfectly fine and displays something like this:
$2y$10$BMuRYvrhQbPduARvea7aLe4kwzrahfkvscEmzxvVdF8Y80f5ZxX5C
However, when trying to run the same exact script on a server, this function doesn't work. Nothing is displayed and when I try writing other code after this function, like:
echo"hi";
this doesn't display either. This means that some kind of error is occurring with the password_hash() function. I'm having the same problems with password_verify().
I checked the php versions of my server and localhost.
localhost: php version: 5.6.31 server: php version 5.4.16
Is there a problem with the server's php version or is it a problem that's most likely specific to my server only?