|
|
Escrito por
Papillork
el 18/01/2007
Hola, tengo un script prueba. Cgi #! /usr/bin/python import os, time, sys print "Content-type: text/html\r\n" print time. Gmtime() print os. System('cat /etc/network/interfaces') la ejecucion de este archivo desde la shell funciona ok. (python prueba. Cgi) El problema ocurre en apache cuando lo ejecuto, tengo problemas con la ultima linea, especificamente el comando "os. System('cat...). Si comento la linea todo funciona bien. el archivo log me muestra lo siguiente. [Thu Jan 18 11:33:52 2007] [error] [client 127.0.0. 1] malformed header from script. Bad header=# This file describes the netw: /usr/lib/cgi-bin/prueba. Cgi [Thu Jan 18 11:33:52 2007] [error] [client 127.0.0. 1] File does not exist: /var/www/favicon. Ico si me pueden ayudar. |
|
|
Citar |
Ver mensaje
|
|
Escrito por
Iomateix
el 19/01/2007
No tendrás python como módulo y estás intentando ejecutarlo sin contenerlo dentro de la carpeta cgi-bin?
|
|
Escrito por
Darkness51
el 11 de Octubre
Hola, creo que tu problema esta en esta linea: print "Content-type: text/htmlrn" deberia de quedarte asi: print "Content-type: text/html" Saludos " Hola, tengo un script prueba. Cgi #! /usr/bin/python import os, time, sys print "Content-type: text/htmlrn" print time. Gmtime() print os. System("cat /etc/network/interfaces") la ejecucion de este archivo desde la shell funciona ok. (python prueba. Cgi) El problema ocurre en apache cuando lo ejecuto, tengo problemas con la ultima linea, especificamente el comando "os. System("cat...). Si comento la linea todo funciona bien. el archivo log me muestra lo siguiente. [Thu Jan 18 11:33:52 2007] [error] [client 127.0.0. 1] malformed header from script. Bad header=# This file describes the netw: /usr/lib/cgi-bin/prueba. Cgi [Thu Jan 18 11:33:52 2007] [error] [client 127.0.0. 1] File does not exist: /var/www/favicon. Ico si me pueden ayudar." por Papillork (Enero 2007)
|
|
Al escribir en el debate:
|