Re: [Ssh-sftp-perl-users] problem with CGI
Brought to you by:
dbrobins
From: Nigel R. <ni...@sy...> - 2013-11-14 17:15:58
|
Not sure why it would just hang, looking at the script you should get a 500 error, unless you taken some bits out. There's no content type so the browser will take the first line of input and not know what to do with it. What browser are you using? Try adding print "Content-type: text/plain"; before any other output and see if that helps. From: Fernando Buzon [mailto:fb...@cr...] Sent: Thursday, November 14, 2013 10:38 AM To: ssh...@li... Subject: Re: [Ssh-sftp-perl-users] problem with CGI Thanks friend! But it is not my problem. If I execute a cmd that no returns nothing in stdout, it works. example: my $cmd = "svn --help"; (Page never load...) my $cmd = "svn --help > /dev/null"; (Page load OK and fast) And like I said, at command line both cases works nice. The problem is execute a cmd that returns anything to stdout page neve load and after a time get time out. 2013/11/14 Nigel Reed <ni...@sy...> Have a look at this thread. http://www.tek-tips.com/viewthread.cfm?qid=1140435 From: Fernando Buzon [mailto:fb...@cr...] Sent: Thursday, November 14, 2013 5:36 AM To: ssh...@li... Subject: [Ssh-sftp-perl-users] problem with CGI Hi guys. My script don't work in apache. look this: =================================================================== #!/usr/bin/perl use CGI; use HTTP::Request::Common qw(POST); use Net::SSH::Perl; use DateTime; use warnings; use strict; my $user = 'user'; my $pass = 'pass'; my $cmd = "svn --help"; my $ssh = Net::SSH::Perl->new('10.10.1.1'); $ssh->login($user, $pass); my($stdout, $stderr, $exit) = $ssh->cmd("$cmd"); if ($stdout) { print "stdout -> " . $stdout . "\n"; } else { print "stderr -> " . $stderr . "\n"; } print "exit -> " . $exit . "\n"; =================================================================== At line command this is ok but executing in apache the page never load... Still loading page until time out. What's the problem? help-me... Thanks! |