Welcome Guest, Not a member yet? Register   Sign In
Error after transferring CI application to web server
#1

[eluser]Ray Julich[/eluser]
I've create an application on my local computer using CI and Xampp, but when I copied it over to my web server, I'm getting the following errors messages on each page:

Code:
A PHP Error was encountered
Severity: Warning

Message: mcrypt_get_iv_size() [function.mcrypt-get-iv-size]: Module initialization failed

Filename: libraries/Encrypt.php

Line Number: 256
Code:
A PHP Error was encountered
Severity: Warning

Message: mcrypt_create_iv() [function.mcrypt-create-iv]: Can not create an IV with a size of less then 1 or greater then 2147483647

Filename: libraries/Encrypt.php

Line Number: 257
Code:
A PHP Error was encountered
Severity: Warning

Message: mcrypt_encrypt() [function.mcrypt-encrypt]: Module initialization failed

Filename: libraries/Encrypt.php

Line Number: 258

They point to the following lines in the Encrypt.php library:
Code:
$init_size = mcrypt_get_iv_size($this->_get_cipher(), $this->_get_mode());
        $init_vect = mcrypt_create_iv($init_size, MCRYPT_RAND);
        return $this->_add_cipher_noise($init_vect.mcrypt_encrypt($this->_get_cipher(), $key, $data, $this->_get_mode(), $init_vect), $key);

Am I forgetting to copy over any files from my local computer to the web server? I'm at a loss as to why I'm getting these errors on every page.
#2

[eluser]danmontgomery[/eluser]
post the code where you set the cipher and call encode() or decode()
#3

[eluser]WanWizard[/eluser]
The way you initialize mcrypt depends on the version of mcrypt loaded.
As always, Google is your friend...
#4

[eluser]Ray Julich[/eluser]
I'm never calling an encode() or decode() directly from my code. I include library('form_validation') and library('session') in a few on my controllers, but not using those libraries on the particular page I'm getting these errors on.
#5

[eluser]WanWizard[/eluser]
It could be that libcrypt doesn't match the mcrypt requirement, some ciphers could be missing. Have your admins check that.
#6

[eluser]Ray Julich[/eluser]
On my local computer, I'm using Apache 2.2.X on Windows XP. On my web server, I'm also using Apache 2.2.X, but on Solaris. My local computer's php.ini file says it's using php_mcrypt.dll (File date 12/10/2009). My web server's php.ini file says it's using mcrypt.so (File date 10/14/2009). I'm not sure how to tell if my web server is missin any ciphers or if it's out-of-date.
#7

[eluser]WanWizard[/eluser]
You can run phpinfo() to get details on your mcrypt installation.

You need your Solaris admin to get libcrypt up to date. Knowing Solaris, that probably means compiling from source...
#8

[eluser]Ray Julich[/eluser]
I got the issue fixed. I'm using the Blastwave php, etc. packages, there was a bug in their most current libmcrypt package release that was missing the ciphers so I had to go back to a previous version of the package. I found my answer on the Blastwave forum.




Theme © iAndrew 2016 - Forum software by © MyBB