使用php eval函数来执行PHP代码时,常常由于提交给eval函数执行的代码不是合法的PHP代码,而导致http服务返回"HTTP/1.0 500 Internal Server Error"错误。尝试使用下面方式进行异常处理:

try {
   eavl("code...");
} catch(Exception $e){}
或者:
  @eavl("code...");
后发现页面依然返回http 500错误,在网上google一下才发现这是一个bug,通过下面方式得以解决:
ini_set('display_errors', 'on');
try {
   eavl("code...");
} catch(Exception $e){}
ini_set('display_errors', 'on');
或者:
  ini_set('display_errors', 'on');
  @eavl("code...");
  ini_set('display_errors', 'off');