Mcrypt is installed, but error implies it's not. |
Codeigniter 2.2 displays error, “The Encrypt library requires the Mcrypt extension.”
I’m running PHP 5.6.2 (via MAMP) on Yosemite 10.10.1. Phpinfo says mcrypt is enabled. The php log shows no error. Apache log shows no error. This issue occurs only in my local environment. My dev and production environments don’t throw the error (Ubuntu 11.10) I know this has been a common snag with the CI 2.2 upgrade, but mcrypt problems appear resolved when PHP is upgraded, or mcrypt is installed. What am I missing?
I don't own a mac, but I've read here and there that people have issues with yosemite, mcrypt and php 5.6. Some resolve it by downgrading php to 5.5. But here it seems someone resolved an issue like this: http://stackoverflow.com/questions/26493...stallation
Website: http://tomaz.lovrec.eu
GitHub: https://github.com/slax0rr Twitter: https://twitter.com/slax0rr
Thanks for the link. I'm running PHP under MAMP, not Yosemite's version. Nevertheless I did try switching to earlier versions of PHP, but still no success.
Like I said, do not own a mac, never had actually, so I don't know about this issue. All I know it is weird, tried setting it up for a coworker.
May I suggest using a VM for developing? Take a look at Vagrant, and http://puphpet.com It will help you with issues like this, and also isolate your development environment, but don't worry, you still write your code as you did before.
Website: http://tomaz.lovrec.eu
GitHub: https://github.com/slax0rr Twitter: https://twitter.com/slax0rr
Maybe you have not installed all dependencies?
This article could you help http://coolestguidesontheplanet.com/inst...nt-server/
My issue comes AFTER successfully doing all those things mentioned in the article. My phpinfo() already indicates that mcrypt is enabled and that extension_dir is set to the extension folder of the version of php I'm running. For MAMP, miine is:
/Applications/MAMP/bin/php/php5.5.18/lib/php/extensions/no-debug-non-zts-20121212 Apache, PHP and Mcrypt appear to be installed correctly. The issue occurs when Codeigniter runs the Encryption Class. The constructor for CI_Encrypt "determines whether the mcrypt library exists" with this call: function_exists('mcrypt_encrypt'). It's that call that fails, and so reports "The Encrypt library requires the Mcrypt extension."
have you tried to use mycrypt as standalone php. maybe you get there also an error?
PHP Code: echo trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, 'your-salt_bla123', 'the secret message', MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));
A separate PHP file, that you can load up in your web browser, like http://localhost/path/to/standalone/file.php
Website: http://tomaz.lovrec.eu
GitHub: https://github.com/slax0rr Twitter: https://twitter.com/slax0rr (11-21-2014, 09:41 AM)marksalvatore Wrote: Codeigniter 2.2 displays error, “The Encrypt library requires the Mcrypt extension.” I don't know if this is related to your problem, but when I upgraded to CI 3.0, I found a bug in the CI library, which was very kindly fixed for me. https://github.com/bcit-ci/CodeIgniter/issues/3317 This might be what you are seeing, and XAMPP and MAMP are not massively different. |
Welcome Guest, Not a member yet? Register Sign In |