Dear Experts,
Q: How to enable MCRYPT module in PHP/ZF?
I have done the following;
1. Ensured that libmcrypt.dll and php_mcrypt.dll are in the c:\php\ext directory.
2. php.ini file modified to include the following;
extension_dir = "c:\php\ext"
extension=php_mcrypt.dll
include_path=".;c:\php\ext;C:\php\pear;c:\php\includes;c:\zendframework196\library"
3. Restarted Apache.
4. I am running the following code in my Test2Controller.php file
$inputtext = $this->_request->getParam('inputtext');
$key = 'SomeSaltKeyThatIsASecret';
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$encryptedtext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $inputtext, MCRYPT_MODE_ECB, $iv);
$decryptedtext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $encryptedtext, MCRYPT_MODE_ECB, $iv);
Still I am getting the following error;
Fatal error: Call to undefined function mcrypt_get_iv_size() in C:\local\myapps\application\controllers\Test2Controller.php on line 42
I have referred to PHP documentation and searched online for help. Look like I am doing the right things. Is there anything that I am missing in enabling the mcrypt module. In the PHP documentation "Installation:
You need to compile PHP with the --with-mcrypt[=DIR] parameter to enable this extension. DIR is the mcrypt install directory. Make sure you compile libmcrypt with the option --disable-posix-threads."
which I dont understand. Please Help.
Regards
Takeme2Web-Bala