Home  |  Linux  | Mysql  | PHP  | XML
From:alexander simashin Date:Sat Dec 19 08:39:04 2009
Subject:Re: script working from shell, but not from browser.
So it is time for an easy example script.
i wrote this little example maybe it will be clearly describe my problem. I
did not use any files or something for no more possible problems with
permissions.
*#!/usr/bin/perl
use CGI ;
use strict;
use warnings;
use Data::Dumper;
use CGI::Carp 'fatalsToBrowser';
use HTTP::Request::Common;
use vars qw($ua $h1 $response $req1 $suc $query);
use LWP::UserAgent;

$ua = new LWP::UserAgent;
$query = new CGI;# CGI
print $query->header;
$h1 = new HTTP::Headers;
$req1 = new HTTP::Request ('GET', 'http://www.cpan.org', $h1);
$response=$ua->request($req1);
print Dumper($response);
print $query->end_html;

*
So, when i run this from shell everything is okay and i get cpan.org page,
but from browser it gives Can\'t connect to www.cpan.org:80 (connect:
Permission denied.
You can see this result here http://62.176.11.182:50235/cgi-bin/test1.cgi
(test1.cgi is right the script above).
The problem seems really be in apache or httpd.conf or in CGI , but i can`t
understand where.
*
*

Navigate in group perl.beginners.cgi at sever nntp.perl.org
Previous Next


Your recent visits
Re: Need help to resove..... ExtUtils-Makemaker comilationS
Re: Loading results (via ajax) from a CGI
Re: problems with 'require'



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants