php 4.0.6 problems with mcrypt
| From: | Dixie Flatline | Date: | Sat, 21 Jul 2001 09:11:11 +0000 |
| Subject: | php 4.0.6 problems with mcrypt | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-59006@lists.php.net to get a copy of this message | ||
Greetings!
I've compiled a new php 4.0.6 as an apache module with added mcrypt support.
When I invoke the following code:
---------------------
function hex2bin($data) {
$len = strlen($data);
return pack("H" . $len, $data);
}
$iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_BLOWFISH,
MCRYPT_MODE_CBC), MCRYPT_RAND);
echo $iv."<br>";
$iv_hex = bin2hex($iv);
echo hex2bin($iv_hex)."<br>";
$key = "This is a very secret key";
$text = "Meet me at 11 o'clock behind the monument.";
$crypttext = mcrypt_encrypt (MCRYPT_BLOWFISH, $key, $text, MCRYPT_MODE_CBC,
$iv);
echo mcrypt_decrypt (MCRYPT_BLOWFISH, $key, $crypttext, MCRYPT_MODE_CBC,
$iv);
---------------------
php gives an error at this line:
$crypttext = mcrypt_encrypt (MCRYPT_BLOWFISH, $key, $text, MCRYPT_MODE_CBC,
$iv);
Fatal error: generic_init failed in /var/www/www.hardwired.hu/html/a.hw on
line 19
And my apache log contains the following:
can't close resident module
What could be the problem?
I've got Debian Potato 2.2.19 with Apache 1.3.20 and PHP 4.0.6.
Best Regards,
Dixie Flatline