Foros del Web » Programando para Internet » PHP »

Error con JpGraph Error: HTTP headers have already been sent

Estas en el tema de Error con JpGraph Error: HTTP headers have already been sent en el foro de PHP en Foros del Web. Hola Amigos estoy graficando con jpgraph y tengo el siguiente problema, y la verdad es que no tengo ningun echo, por ninguna parte, no se ...
  #1 (permalink)  
Antiguo 06/02/2011, 00:43
 
Fecha de Ingreso: marzo-2005
Mensajes: 372
Antigüedad: 19 años, 1 mes
Puntos: 1
Error con JpGraph Error: HTTP headers have already been sent

Hola Amigos estoy graficando con jpgraph y tengo el siguiente problema, y la verdad es que no tengo ningun echo, por ninguna parte, no se a que se refiere y siempre es en la linea 1, copio y pego ejemplos de internete y en todos me sale este mismo error.

JpGraph Error: HTTP headers have already been sent.
Caused by output from file accbarex1.php at line 1.
Explanation:
HTTP headers have already been sent back to the browser indicating the data as text before the library got a chance to send it's image HTTP header to this browser. This makes it impossible for the library to send back image data to the browser (since that would be interpretated as text by the browser and show up as junk text).
Most likely you have some text in your script before the call to Graph::Stroke(). If this texts gets sent back to the browser the browser will assume that all data is plain text. Look for any text, even spaces and newlines, that might have been sent back to the browser.

For example it is a common mistake to leave a blank line before the opening "<?php".

Código PHP:
<?php
require_once ('src/jpgraph.php');
require_once (
'src/jpgraph_bar.php');
$data1y=array(8,8,9,3,5,6);
$data2y=array(18,2,1,7,5,4);
$graph = new Graph(500,400); 
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->img->SetMargin(40,30,20,40);
$b1plot = new BarPlot($data1y);
$b1plot->SetFillColor("orange");
$b1plot->value->Show();
$b2plot = new BarPlot($data2y);
$b2plot->SetFillColor("blue");
$b2plot->value->Show();
$gbplot = new AccBarPlot(array($b1plot,$b2plot));
$graph->Add($gbplot);
$graph->title->Set("Accumulated bar plots");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->Stroke();
?>
saludos
  #2 (permalink)  
Antiguo 06/02/2011, 07:50
Avatar de Ronruby  
Fecha de Ingreso: julio-2008
Ubicación: 18°30'N, 69°59'W
Mensajes: 4.879
Antigüedad: 15 años, 9 meses
Puntos: 416
Respuesta: Error con JpGraph Error: HTTP headers have already been sent

Debe ser esto:
http://www.forosdelweb.com/wiki/PHP:...lready_sent%3F
  #3 (permalink)  
Antiguo 06/03/2015, 09:31
 
Fecha de Ingreso: agosto-2013
Ubicación: San Pedro Sula
Mensajes: 12
Antigüedad: 10 años, 7 meses
Puntos: 0
Respuesta: Error con JpGraph Error: HTTP headers have already been sent

¿Encontró usted el error? yo tengo el mismo problema, necesito saber como solucionarlo.

Etiquetas: jpgraph, header, https
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:40.