Apache 500 error help

Apache 500 error help

Hello,

Im using CGI to access paypal. It's connecting, returning successful paypal response. But, Im getting an http 500 error. The error log says:

[Fri Mar 14 99:99:99:99 2014] [error] [client 88.88.88.88] ZSRV_MSG0108: Header from script is not valid. Bad header is Key Manager Factory:

Im using an ajax call to a java program within my domain that is sending a request to paypal, getting a successful response but returning an apache 500 error. The program works because I can run it from a command line and it terminates normally 

Is there some header info I may be missing?
 
My script is as:

var $cust = $("#SCCUST").val();                                     
$.ajax({                                                            
type: 'get',                                                        
async : false,                                                      
timeout: 30000,                                                     
dataType: 'text',                                                   
url:'IPAL03A.PGM',                                                  
data:{port:"TST", SCCUST:$cust, totpra:totprice.toString(), tottxa: 
success: function($ipal){                                           
console.log('success: ' + $ipal);                                   
 $("#waitmsg").hide();                                              
 $("#ipal").empty();                                                
 $("#ipal").append($ipal);          
      $("#ipal").append($ipal);               
$("#ipal").dialog({                     
  modal: true,                          
  height: 650,                          
  width: 650,                           
  buttons: {                            
      Close: function() {               
       $( this ).dialog( "close" );     
      }                                 
     }                                  
});                                     
   }