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';
}

检查是否启用了那些需要的功能。