当前位置: 动力学知识库 > 问答 > 编程问答 >

encryption - PHP encrypted $_GET variables throws Fatal error: Allowed memory size exhausted

问题描述:

Why if i put

w3Zho+mol6yATVfhqi8KkQ== ("ln -s")

Then this doesn't work:

function cdecrypt($data) {

$key = '000000';

$iv = '1234567812345678';

$decrypted = openssl_decrypt($data, "aes-128-cbc", $key, 0, $iv);

return $decrypted;

}

$c = urlencode($_GET['c']);

$comm = cdecrypt(urldecode($c));

echo $comm;

Error:

 Fatal error: Allowed memory size of 268435456 bytes exhausted

(tried to allocate 3095496193 bytes) in /var/www/ai/service.php on line 7

but if i change encrypted string to

 QYRiSyTwk4r6Js6jNVlziQ== ("ln -ls")

it shows decrypted string (in this case ln -ls) just fine?

网友答案:

If you can edit your php.ini file you should increase the memory limit higher then 3095496193 bytes by adding or modifiying that line on your php.ini file:

memory_limit = 300M

or a higher limit.

分享给朋友:
您可能感兴趣的文章:
随机阅读: