Tema: gzip duda
Ver Mensaje Individual
  #5 (permalink)  
Antiguo 30/11/2010, 07:13
alkohol
 
Fecha de Ingreso: octubre-2010
Mensajes: 13
Antigüedad: 13 años, 6 meses
Puntos: 0
Respuesta: gzip duda

Gracias por responder

revice lo que me dijiste

primero que nada revice mi configuracion de php
<?php
phpinfo();
?>


* Server API Apache 2.0 Handler

*ZLib Support enabled
Stream Wrapper support compress.zlib://
Stream Filter support zlib.inflate, zlib.deflate
Compiled Version 1.2.3
Linked Version 1.2.3

Directive Local Value Master Value
zlib.output_compression Off Off
zlib.output_compression_level -1 -1
zlib.output_handler no value no value


cree el archivo linea.xml.php, primero quiero ver que se visualice asi que no le hice ningún cambio

Código PHP:
Ver original
  1. <?php
  2. header("Content-Type: text/xml;charset=utf-8");
  3. header("Cache-Control:must-revalidate");
  4. ob_start("ob_gzhandler");
  5. $offset = 60 * 60;
  6. $ExpStr = "Expires:" .
  7. gmdate("D,d M Y H:i:s",time() + $offset) . " GMT";
  8. header($ExpStr);
  9.  
  10. echo<<<XML
  11. <?xml version="1.0" encoding="UTF-8"?>
  12. <datos>
  13. <!-- el resto de tu xml -->
  14. </datos>
  15. XML;
  16. ?>



y me salio el siguiente problema

Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\linea.xml.php:1) in D:\xampp\htdocs\linea.xml.php on line 2

Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\linea.xml.php:1) in D:\xampp\htdocs\linea.xml.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\linea.xml.php:1) in D:\xampp\htdocs\linea.xml.php on line 8





PD: los ejemplos de http://gzip.emprear.com.ar/, los descarge y los pege en D:\xampp\htdocs\
con la herramienta "Live HTTP headers" vi las cabecera del sitio y sale la compresion por Gzip (Content-Encoding = gzip).