2013-03-25 98 views
1

我必须部署一个应用程序在php上调试,它是使用一个wamp服务器开发的(在win上)。现在我必须将它部署在apache2 debian服务器上。该应用程序在使用wamp的开发人员PC上运行,但无法在debian服务器上运行。AJAX XMLHttpRequest给出错误

的问题是,所有的网格(jQuery的网格)的内容加载用ajax

grid.jqGrid({ 
      datatype: "xml", 
      url:'../Controladores/cPedidos.php?action=lpd', 
      mtype: 'POST', 
      colNames:['FECHA','DEPOSITO','USUARIO'], 
      colModel:[ 
       {name:'fecha_pedido',index:'fecha_pedido',width:120, sorttype: 'date'}, 
       {name:'deposito',index:'deposito',width:500, editable:false}, 
       {name:'usuario_id',index:'usuario_id',width:150, editable: false} 
      ], 
      rowNum:10, 
      rowList:[10,20,40], 
      pager: '#paginacion', 
      gridview:true, 
      rownumbers:true, 
      ignoreCase:true, 
      sortname: 'fecha_pedido', 
      viewrecords: true, 
      sortorder: "asc", 
      caption:"Pedidos", 
      height: "100%", 
      subGrid : true, 
      subGridUrl: '../Controladores/cPedidos.php?action=lad', 
      subGridModel: [{ name : ['Codigo','Cantidad','Articulo','Estado','Categoria','Observaciones'], 
       width : [50,50,450,60,60,150] }], 
      editurl: '../Controladores/cPedidos.php?action=editar', 
      ondblClickRow: function(id, ri, ci) { 
       // edit the row and save it on press "enter" key 
       grid.jqGrid('editRow',id,true,null,null, 'clientArray'); 
      }, 
      onSelectRow: function(id) { 
       if (id && id !== lastSel) { 
        // cancel editing of the previous selected row if it was in editing state. 
        // jqGrid hold intern savedRow array inside of jqGrid object, 
        // so it is safe to call restoreRow method with any id parameter 
        // if jqGrid not in editing state 
        if (typeof lastSel !== "undefined") { 
         grid.jqGrid('restoreRow',lastSel); 
        } 
        lastSel = id; 
       } 
      } 
     }).jqGrid('navGrid','#pager',{add:false,edit:false},{},{},myDelOptions,{multipleSearch:true,overlay:false}); 
     //grid.jqGrid('filterToolbar',{defaultSearch:'cn',stringResult:true}); 
     $("#filtro").change(function(){ 
      var valor = $("#filtro").val(); 
      $("#tablapedidos").jqGrid().setGridParam({url:'../Controladores/cPedidos.php?action=lpd&filtro='+valor}).trigger('reloadGrid'); 
     }); 

的问题是,什么都不装,使用Firebug我得到那个职位的url被中止。如果我直接在浏览器上输入url(ff),我得到一个“连接已重置”错误,Chrome:“错误324(net :: ERR_EMPTY_RESPONSE)”。如果我这样做对开发商的电脑我得到的XML文件的本地主机中,URL页面使用回声, 范例(未完成)

function getArticulosPendientes() { 
if (stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) { 
header("Content-type: application/xhtml+xml;charset=utf-8"); } else { 
header("Content-type: text/xml;charset=utf-8"); 
} 
$et = ">"; 
echo "<?xml version='1.0' encoding='utf-8'?$et\n"; 
echo "<rows>"; 

$lista = getListaArticulosPendientes($_POST); 
$resultado = array(); 

for($i = 0; $i < count($lista); $i++) { 
    $fila = $lista[$i]; 
    $dif = diferenciaCompradoPedido($fila['item_id']); 
    if($dif > 0) { 
     $fila['cantidad'] = $dif; 
     array_push($resultado, $fila); 
    } 
    else { 
     array_push($resultado, $fila); 
    } 
} 

for($a = 0; $a < count($resultado); $a++) { 
    $row = $resultado[$a]; 
    $fecha = date("d/m/Y H:i", strtotime($row["fecha_pedido"])); 
    echo "<row id='". $row["item_id"]."'>"; 
    echo "<cell>". $fecha."</cell>"; 
    echo "<cell>". $row["cantidad"]."</cell>"; 
    echo "<cell><![CDATA[". utf8_encode($row["descripcion"])."]]></cell>"; 
    echo "<cell><![CDATA[". $row["categoria"]."]]></cell>"; 
    echo "<cell><![CDATA[". $row["usuario_id"]."]]></cell>"; 
    echo "<cell><![CDATA[". $row["estado"]."]]></cell>"; 
    echo "<cell><![CDATA[". $row["observaciones"]."]]></cell>"; 
    echo "</row>"; 
} 
echo "</rows>"; 

}

任何想法创建XML文件

回答