Topic on Project:Support desk

Jump to navigation Jump to search

mcrypt_create_iv() [function.mcrypt-create-iv]: Cannot open source device

6 (talkcontribs)


I have installed version 1.19.1 on my host (windows based host) by I receive warning on top of the page when I go to wiki page at

Any idea why I get "mcrypt_create_iv() [function.mcrypt-create-iv]: Cannot open source device" warning?

Regards, Arash

Bawolff (talkcontribs)

There's been several reports of mcrypt failing on windows. See bugzilla:35894.

Assuming it lets you install, don't worry about the error, and after install, edit LocalSettings.php and change $wgSecretKey to something random. (talkcontribs)


I have entered some data already, does this change to $wgSecretKey would make new entries unusable?

Regards, Arash

Bawolff (talkcontribs)

It may cause people who are logged in to become logged out (They would have to re-login). It should not affect anything else.

There's information on what $wgSecretKey is used for here. (talkcontribs)

Locate the file includes/CryptRandom.php. Find the following line (probably around line 285): $iv = mcrypt_create_iv( $rem, MCRYPT_DEV_URANDOM ); Change it to: $iv = mcrypt_create_iv( $rem, MCRYPT_RAND );

Kghbln (talkcontribs)

So if I cannot modify "CryptRandom.php" I still will have to make sure that $wgSecretKey is not leaked as in versions prior to MW 1.17 (well, I should do so anyway, but I guess you will get the point).

Reply to "mcrypt_create_iv() [function.mcrypt-create-iv]: Cannot open source device"