[pmwiki-users] Uncaught ArgumentCountError: crypt() expects exactly 2 arguments

Petko Yotov 5ko at 5ko.fr
Sat Jul 5 07:49:10 PDT 2025


On 05/07/2025 15:57, Donald Z. Osborn wrote:
> Uncaught ArgumentCountError: crypt() expects exactly 2 arguments,
> 1 given
...
> Uncaught ArgumentCountError: crypt() expects exactly 2 arguments,
> 1 given
...
> What I did: Searched the PmWiki.org site for possible updates or
> guidance, but no luck.

Thanks for providing the detailed error message -- it's helpful for 
narrowing things down. Since you've already done some searching without 
success, I'd recommend trying a more specific query like:

   
https://www.pmwiki.org/wiki/?action=search&q=Uncaught+ArgumentCountError

That search should lead you directly to the relevant documentation 
around this error. It appears to be related to a change in PHP's 
handling of the crypt() function in recent versions, and there's a note 
on the site addressing it.

Let us know if that doesn't turn up the right page -- happy to dig 
further if needed.

> PS- The fact that encrypted passwords are publically displayed in the
> error messages on these sites is problematic. Is this something that
> can be changed? (I munged them in this email but that by now is just
> symbolic).

You're absolutely right -- displaying encrypted passwords in error 
messages is a security concern, especially if they're not hashed.

To prevent this in the future, you can pre-hash your passwords and store 
the resulting hash directly in config.php, without wrapping it in 
pmcrypt(). This avoids exposing them unintentionally and is also a bit 
more efficient.

To generate a valid hash, visit a working wiki on the same hosting (or 
once this one is fixed) and go to:

   index.php?action=crypt

Enter your password there to generate the hash. Then, update your config 
to include the hash directly.

For full details, see:
   https://www.pmwiki.org/PasswordsAdmin

And as a precaution, it's a good idea to update any passwords that may 
have been exposed.

Let us know if anything else comes up -- happy to help.

Petko




More information about the pmwiki-users mailing list