I'm getting an error with the Mcrypt library on my webhost. I'm using the Laravel 4 framework (currently in beta). It's giving the following error:
ErrorException: Warning: mcrypt_create_iv() [function.mcrypt-create-iv]: Cannot open source device in foo/bar line #
Some hosting specs:
- Shared hosting
- PHP 5.3.18
- Linux
- Mcrypt 2.5.8
What's happening is that somewhere in the framework mcrypt_create_iv() gets called. It passes the MCRYPT_DEV_URANDOM global which should work on Linux and PHP >= 5.3.0
But for some reason it still gives this ErrorException. If I hardcode the function to use MCRYPT_RAND instead it works but it seems odd to my why it's giving an error on the other global which should by all means work on these specs.
All I can think of is that somewhere some folders got mixed up or there's something wrong with /dev/urandom. I'm not familiar with these types of encryption so I'm hoping anyone can give me some suggestion on how to fix it.
http://en.wikipedia.org/wiki//dev/random
UPDATE
Someone suggested that my website doesn't has access to the encryption folders. This could be the problem. I'm contacting my webhost about it.