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



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to