Re[2]: cgi and mod_perl-1.26, Apache-1.27, perl-5.8.0, FreeBSD failwith 'The document contained no data'
-BEGIN PGP SIGNED MESSAGE- Hash: MD5 Hi George, I've not seen any of this thread other than what's below, but have you had all the headers output correctly? Try running this after setting $url, and see what you get: use LWP::UserAgent; $url = "http://195.117.126.24";; $ua = LWP::UserAgent->new; $req = new HTTP::Request('GET', $url); # Format URL request $res = $ua->request($req); if (not $res->is_success()) { die "...failed:\n" . $res->error_as_HTML } warn $res->headers_as_string; warn $res->content; #open OUT, ">/test.html"; #print OUT $res->content; #close OUT; exit; Lee On Sunday, February 2, 2003 at 7:42:12 PM, you wrote: GS> Hi Stas, GS> Thanks for your reply. GS> The file perms are correct and nothing is printed to the logs. GS> The scripts do run. If you write a script with a redirect in it GS> for instance, the redirect is made. They just don't seem to GS> print anything to stdout. GS> Regards, George Savvides. GS> Stas Bekman wrote: >> >> What has error_log to say about this? Do you have the file perms right? >> - -- Cheers Leemailto:[EMAIL PROTECTED] $$=qw$808273788400074285838400657879847269820080698276007265677569820727$; $$=~s$(\d\d)$\$_.=chr(\$1+32)$ge;eval; -BEGIN PGP SIGNATURE- Version: 2.6 iQCVAwUAPj1zYqdrfekeF/QBAQEDxgQAoYOSvKGOBHUXgwRcRHdatlAo71tpR4NQ 55fgPbL0e20JiKQ+0X8xbbT6Lixh1ytkIfJZIr3J+7iiIYagkGkrMukFw9IrfMgF pxu5zY589u1U8BrSzlQIUtMuvmtc40JXZMh5jc/zuasVw0WaeHRVAVsi6wa7qCDE 4MDgvzcuz/g= =k9JH -END PGP SIGNATURE-
Re[2]: cgi and mod_perl-1.26, Apache-1.27, perl-5.8.0, FreeBSD failwith 'The document contained no data'
-BEGIN PGP SIGNED MESSAGE- Hash: MD5 Hi George, On Monday, February 3, 2003 at 10:47:47 PM, you wrote: GS> Hi Lee, GS> Thanks for your reply. I tried the script you sent and it failed GS> with "document contains no data". This is odd because I GS> previously found that mod_perl API scripts ran ok but CGI scripts GS> running under mod_perl failed. GS> The script printed some output in the log which I have attached GS> below. I've also attached the earlier messages in the thread in GS> case they might help. Yes, sorry: it sent the warnings to the log. I just meant that if you ran that little script from the command line, it should show you exactly what you are getting back: whether or not the document really has no data, or whether there is a CRLF missing between the header and content body. My guess is that it's your user agent, not your server. I've had all sorts of problems with Macintosh browsers not displaying things that everything except Lynx will. I don't know: you're doing this: print "Content-type: text/plain\n\n"; print "Hello World\n"; Does it (probably not) make any difference if you do a full CRLF, as perldoc perlop: For example, most networking protocols expect and prefer a CR+LF (""\015\012"" or ""\cM\cJ"") for line terminators, and although they often accept just ""\012"", they seldom tolerate just ""\015"". If you get in the habit of using ""\n"" for networking, you may be burned some day. - -- Cheers Leemailto:[EMAIL PROTECTED] $$=qw$808273788400074285838400657879847269820080698276007265677569820727$; $$=~s$(\d\d)$\$_.=chr(\$1+32)$ge;eval; -BEGIN PGP SIGNATURE- Version: 2.6 iQCVAwUAPj7mfqdrfekeF/QBAQHcogP+P6ebE/Qz72C6s960eRTG7v18IMBW3y1U e0QD4gjmlrDKwXhUKSfQYj3PEE0RJ06E/XeyqkGa08wnHWmMvAURuIDsiffaSIbl pmWBEWMwoJBy0ywXPa4vMVRH/FvII7nGdymCkFSW5bzwRi2TxTxnIogZScMaB1Kd 5GFV7Wpgsj8= =MQdQ -END PGP SIGNATURE-
Re[2]: cgi and mod_perl-1.26, Apache-1.27, perl-5.8.0, FreeBSD failwith 'The document contained no data'
-BEGIN PGP SIGNED MESSAGE- Hash: MD5 Hi Stas, On Tuesday, February 4, 2003 at 2:47:43 AM, you wrote: SB> Lee Goddard wrote: SB> [...] >> I don't know: you're doing this: >> >> print "Content-type: text/plain\n\n"; >> print "Hello World\n"; >> >> Does it (probably not) make any difference if >> you do a full CRLF, as perldoc perlop: >> >> For example, most networking protocols expect >> and prefer a CR+LF (""\015\012"" or ""\cM\cJ"") for line terminators, >> and although they often accept just ""\012"", they seldom tolerate just >> ""\015"". If you get in the habit of using ""\n"" for networking, you >> may be burned some day. SB> Apache already fixes up "\n\n" to the right thing. What it really does SB> is identifying the Content-type: header, and then adds the terminating SB> by itself, because it really sends other headers, before adding an SB> empty new line. So it shouldn't matter if you say "\r\n\r\n" or just SB> "\n\n", unless there is a bug. So if Apache (mod_perl) adds this to his script, even though it is not a mod_perl script, then shouldn't he be calling it from a that isn't mod_perl enabled...? Sorry, just getting into this Apache module thing Cheers lee - -- Cheers Leemailto:[EMAIL PROTECTED] $$=qw$808273788400074285838400657879847269820080698276007265677569820727$; $$=~s$(\d\d)$\$_.=chr(\$1+32)$ge;eval; -BEGIN PGP SIGNATURE- Version: 2.6 iQCVAwUAPj+AYqdrfekeF/QBAQErkgQApGgGWv78D4in/2NmcoBTqMPdKKyYUZia ZN7chLUcduSoyqftj70iU0+PCAheJqX6k+9Q/bErraOoP4g3S5aMW99zYMLfXKtx XhTHhusNkroSGKpyXI7FlyKOaQqDLN+S8vm5QAlEkZlK6ZfgovgevSnCqfsiuc48 /EW2drjX1w0= =Ef7H -END PGP SIGNATURE-