PHP base64_encode失败,脚本终止,页面为空白


PHP base64_encode failed and script terminated with blank page?

我有一个使用base64_encode的现有php脚本,它运行良好,然后当我将该脚本移动到新服务器时,它不起作用,该脚本将以一个空白页终止。

我试图捕捉异常

try
        {
            $encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, md5(md5($key))));
        }
        catch(Exception $ex) 
        {
            echo 'Message: ' . $ex->getMessage(); die;
        }

它仍然只显示一个空白页。知道是什么原因吗?

尝试

if(!function_exists('base64_encode')){
  echo 'base64_encode function not enabled';
}
if(!function_exists('mcrypt_encrypt')){
  echo 'mcrypt not enabled';
}

以检查是否启用了这些所需的功能。