Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/04/2005, 16:22
vgm77
 
Fecha de Ingreso: abril-2005
Mensajes: 39
Antigedad: 19 aos
Puntos: 0
problema de configuracion de header y mime

saludos miembros del foro, tengo un problema con la vizualizacion de una imagen, est es mi codigo:

YO SE QUE ES EXCESIVO Y PIDO UNA DISCULPA PERO LES QUIERO DAR TODOS LOS ELEMENTOS POSIBLES PARA QUE PUEDAN ANALIZAR EL PROBLEMA Y ME DIGAN LAS POSIBLES SOLUCIONES, YA HE ESTADO REVISANDO LOS FAQS SOBRE LOS HEADERS Y LA VERDAD NO LE ENTIENDO MUY BIEN, YA QUE SOY PRIMERIZO, LES AGRADEZCO INFINITAMENTE EL APOYO YA QUE HE ESTADO 15 DIAS TRATANDO DE VISUALIZAR UNA IMAGEN Y NO ME SALE, ESTOY TRABAJANDO CON PWS, PHP. GRACIAS

<HTML>
<HEAD>
<TITLE>destino.php</TITLE>
</HEAD>
<BODY>
<?
// En la cabecera HTTP indicamos que lo que devolvemos es una imagen
// de tipo JPEG. Para ello utilizamos el tipo MIME: image/JPEG
Header("Content-type: image/jpeg");
// Creamos la imagen a partir de un fichero existente
$im = @imagecreatefromjpeg("c:/Inetpub/wwwroot/100.jpeg");
// Mostramos la imagen
Imagejpeg($im);
// Liberamos la memoria que ocupaba la imagen
ImageDestroy($im);
?>
</BODY>
</HTML>


y este es el error:

Warning: Cannot modify header information - headers already
sent by (output started at C:\Inetpub\wwwroot\destino.php:6)
in C:\Inetpub\wwwroot\destino.php on line 9

NO SE QUE ME QUIERE DECIR, YA QUE LA LINEA 9 ES DONDE EMPIEZA EL Header("Content-type: image/jpeg");

en el archivo php.ini modifique lo siguiente:

; As of 4.0b4, PHP always outputs a character encoding by default in
; the Content-type: header. To disable sending of the charset, simply
; set it to be empty.
;
;PHP's built-in default is text/html
default_mimetype = "text/html" ESTE ES EL QUE MODIFIQUE
;default_charset = "iso-8859-1"

EN DEFAULT_MKIMETYPE_"TEXT/HTML" LE QUITE LA COMA Y ME DIO ESTE ERROR:

Warning: Cannot modify header information - headers already
sent by (output started at C:\Inetpub\wwwroot\destino.php:6)
in C:\Inetpub\wwwroot\destino.php on line 9


JFIF>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62),
default quality C    $.' ",#(7)
,01444'9=82<.342C  2!!22222222222222222222222222222222
222222222222222222^^" 
ĵ}!1AQa"q2#BR$3 br
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz

 ĵw!1AQ
aq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWX
YZcdefghijstuvwxyz
?ʉu% 
T>ǵr|l R 9Y'vFx@ZDޱn98l7Aҋ
#<{}*;aٵWhYp=v jlP SY(
TFjP]`Cp>_P 4SԚw.k}Bye/j륩?*W9
EXqԺ":nM]쉰.5KFJIfq[y!O,|r
Mp:ùO3sNk[Du6;w?/sT'v0VCY
D}b)ef*2N9Qho^]#6PGJ:*t}?T'"ڢ6\
yU)/u%RGs4TGQ':p|Pn7s"| &~
N;krڮø`95 .b2{ȕ<H2}t9
Gڙwh6dl:)㷥`KCKm%C}*8|Sy+ /Mͼ`
30TƩ4.٣0z?`uk@*N< ڼ.f
p~c\ւx{

AHORA ES EL MISMO PERO CON TODO EL ARCHIVO DE LA IMAGEN, EN EL ARCHIVO PHP.INI MODIFIQUE LO SIGUIENTE:

;extension=php_bz2.dll
;extension=php_cpdf.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_dbx.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
extension=php_gd2.dllESTE DE AQUI
;extension=php_gettext.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_java.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
extension=php_mime_magic.dllYESTE DE AQUI
;extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
;extension=php_mysql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pdf.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_w32api.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_yaz.dll
;extension=php_zip.dll

Y DE TODAS FORMAS ME SALE EL MISMO ERROR, CON EL PHPINFO(); ME SALIO LO SIGUIENTE:, A LO MEJOR NO HE INSTALADO ALGO O ME FALTA ACTIVARLO, EN MIME MAGIC SUPPORT LO TENGO DESACTIVADO Y NO SE COMO ACTIVARLO DICE QUE ESTA "DISABLE"


bcmath
BCMath support enabled

calendar
Calendar support enabled

com_dotnet
COM support enabled
DCOM support disabled
.Net support enabled

Directive Local Value Master Value
com.allow_dcom 0 0
com.autoregister_casesensitive 1 1
com.autoregister_typelib 0 0
com.autoregister_verbose 0 0
com.code_page no value no value
com.typelib_file no value no value

ctype
ctype functions enabled

dom
DOM/XML enabled
DOM/XML API Version 20031129
libxml Version 2.6.11
HTML Support enabled
XPath Support enabled
XPointer Support enabled
Schema Support enabled
RelaxNG Support enabled

ftp
FTP support enabled

gd
GD Support enabled
GD Version bundled (2.0.28 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.9
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled

iconv
iconv support enabled
iconv implementation "libiconv"
iconv library version 1.9

Directive Local Value Master Value
iconv.input_encoding ISO-8859-1 ISO-8859-1
iconv.internal_encoding ISO-8859-1 ISO-8859-1
iconv.output_encoding ISO-8859-1 ISO-8859-1

ISAPI
Server Variable Value
CONTENT_LENGTH 0
PATH_TRANSLATED C:\Inetpub\wwwroot\prueba.php
REMOTE_ADDR 127.0.0.1
REMOTE_HOST 127.0.0.1
REQUEST_METHOD GET
SERVER_NAME vgm
SERVER_PORT 80
SERVER_PROTOCOL HTTP/1.1
SERVER_SOFTWARE Microsoft-IIS/4.0
APPL_MD_PATH /LM/W3SVC/1/ROOT
APPL_PHYSICAL_PATH C:\Inetpub\wwwroot\
INSTANCE_ID 1
INSTANCE_META_PATH /LM/W3SVC/1
URL /prueba.php
ALL_HTTP HTTP_ACCEPT:image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */* HTTP_ACCEPT_LANGUAGE:es-mx HTTP_CONNECTION:Keep-Alive HTTP_HOST:vgm HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0; Windows 98) HTTP_COOKIE:ASPSESSIONIDFFCWACDB=
LPIFBAPCGMBAEKPAFFFDEBAD;
ASPSESSIONIDFFCRVMDB=EAPBABPCOBHCDFHAEBGCEKJG HTTP_ACCEPT_ENCODING:gzip, deflate
HTTPS off
SCRIPT_NAME /prueba.php
SERVER_PORT_SECURE 0

libxml
libXML support active
libXML Version 2.6.11
libXML streams enabled

mime_magic
mime_magic support

Directive Local Value Master Value
mime_magic.debug Off Off
mime_magic.magicfile C:\php5\magic.mime C:\php5\magic.mime

odbc
ODBC Support enabled
Active Persistent Links 0
Active Links 0
ODBC library Win32

Directive Local Value Master Value
odbc.allow_persistent On On
odbc.check_persistent On On
odbc.default_db no value no value
odbc.default_pw no value no value
odbc.default_user no value no value
odbc.defaultbinmode return as is return as is
odbc.defaultlrl return up to 4096 bytes return up to 4096 bytes
odbc.max_links Unlimited Unlimited
odbc.max_persistent Unlimited Unlimited

pcre
PCRE (Perl Compatible Regular Expressions) Support enabled
PCRE Library Version 4.5 01-December-2003

session
Session Support enabled
Registered save handlers files user sqlite
Registered serializer handlers php php_binary wddx

Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 On On
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 100 100
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 4 4
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path no value no value
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid 0 0

SimpleXML
Simplexml support enabled
Revision $Revision: 1.139.2.4 $
Schema support enabled

SPL
SPL support enabled
Interfaces RecursiveIterator, SeekableIterator
Classes ArrayObject, ArrayIterator, CachingIterator, CachingRecursiveIterator, DirectoryIterator, FilterIterator, LimitIterator, ParentIterator, RecursiveDirectoryIterator, RecursiveIteratorIterator, SimpleXMLIterator

SQLite
SQLite support enabled
PECL Module version 2.0-dev $Id: sqlite.c,v 1.146.2.3 2004/09/26 01:41:40 wez Exp $
SQLite Library 2.8.14
SQLite Encoding iso8859