Solved Acess to wordpress-site not possible: login denied :: PHP's `password_hash()` cannot generate a salt.

Solved issue

dhubs

Active Member
Joined
Nov 5, 2024
Messages
135
Reaction score
68
Credits
2,225
good day dear Community :)

i have had some issues with the login into wordpress: and yes i am still struggling with these issues ... i have worked on sevreal parts - changed the files and checked the database connection etc. etx

No luck at all - i still stuggle with the login issue - i cannot log into the wordpress-site!
.
my friends they said
if none of these work, try enabling debug mode in wp-config.php (define('WP_DEBUG', true) to identify PHP or plugin errors causing the login failure.

this is very helpful:
argh - i have had a closer look at the debug log
believe it or not - i guess that i have some issues - that might be very big..

Code:
PHP Fatal error: Uncaught ValueError: Unable to generate salt

i did alot in the past few days - to find out why the login crashes all the time:

my findings:

Code:
WordPress core is fresh. Database is running. Login fails because PHP's `password_hash()` cannot generate a salt.

The PHP build is likely missing the
Code:
\crypt`, `bcrypt`, and `openssl` modules, or `password_hash()`

or - they re somewhat broken. so i am at the point to check all my PHP modules that are installed and activce or to recompile the whole PHP-thing."`

More specifically:

Code:
\php -m` should list `openssl` and `password`.`
\phpinfo()` shows whether bcrypt is supported.`
Values: \CRYPT_BLOWFISH = 1` → must be present.`

well, i never thought - that the issues were rooted on the server - but i guess that this is the case. The problem seems to bei that indeed on the server and explains exactly why my WordPress installation crashes during login.

my phpinfo shows (and why WordPress login crashes)

here i have had a quite IMPORTANT FINDING:
The configure line contains:

Code:
               '--without-curl

hmm - his means:

Code:
 PHP was compiled without \cURL``

but wait - afaik WordPress uses cURL at several points in the login process – especially for password hashing/salting via password_hash when bcrypt or Argon2 is active.
Hmm - i guess that without cURL + missing system-wide entropy → PHP sometimes cannot generate a salt

what do you say'!? how do you look at these findings!?

assumption / conclusion: This could be the explanation ( probably a exactly one) what causes the error "Unable to generate salt" – at least the text perfectly matches this setup.

what to do - how to proceed!?

hmmm - what do you think about this issue?!

just want to share these thoughts with you here.


what do you say - what are your thoughts - !?


look forward to hear from you :)


greetings
 
Last edited:


good day dear @f33dm3bits :)

first of all : many thanks for the reply. Glad to hear from you.

Just install php from the repos and don't compile it from source.

great advice - this solves a lot of trouble. i am finally there - and it works !!

thank you for sharing your ideas!

have a great day
 
great advice - this solves a lot of trouble. i am finally there - and it works !!
thank you for sharing your ideas!

have a great day
It's always best to use the repo packages. Glad that solves your troubles. Don't forget to mark your topic as solved.
 


Follow Linux.org

Members online


Top