CGI problem

 
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI
View previous topic :: View next topic  
Author Message
empanad0
-


Joined: 31 Jul 2003
Posts: 6

PostPosted: Thu Jul 31, 2003 3:49 pm    Post subject: CGI problem Reply with quote

im having trouble accessing the my cgi scripts online; i get access denied
_________________
(=
Back to top View user's profile Send private message AIM Address
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu Jul 31, 2003 6:28 pm    Post subject: Re: CGI problem Reply with quote

empanad0 wrote:
im having trouble accessing the my cgi scripts online; i get access denied

What is the exact error you get? Is it generate by Abyss Web Server or by another software (see the signature in the bottom of the error page)? Does your scripts work when you access them locally (using http://127.0.0.1 on your computer)?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
empanad0
-


Joined: 31 Jul 2003
Posts: 6

PostPosted: Fri Aug 01, 2003 1:29 am    Post subject: Reply with quote

HTTP 500 - Internal server error
thats what i get, and im using 192.168.1.2; i connect the internet through router although my ports are forwarded
_________________
(=
Back to top View user's profile Send private message AIM Address
os17fan
-


Joined: 21 Mar 2003
Posts: 531
Location: USA

PostPosted: Fri Aug 01, 2003 3:12 am    Post subject: Reply with quote

I Know a good way how you can tell whats wrong with a Perl or CGI , add this line at the top of every CGI or Perl program

Code:
use CGI::Carp qw(fatalsToBrowser);


Instead showing a Internal 500 Error , it will display the problem on the browser it self.
_________________
This web server is the best !
Back to top View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
empanad0
-


Joined: 31 Jul 2003
Posts: 6

PostPosted: Fri Aug 01, 2003 5:49 am    Post subject: Reply with quote

I used the line of code you posted, however the problem is that the server isnt really reading into the cgi folder; it doesnt get to execute the script, doesnt even read the HTML page thats being used to execute it.
_________________
(=
Back to top View user's profile Send private message AIM Address
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Aug 01, 2003 6:25 pm    Post subject: Reply with quote

empanad0 wrote:
I used the line of code you posted, however the problem is that the server isnt really reading into the cgi folder; it doesnt get to execute the script, doesnt even read the HTML page thats being used to execute it.

Error 500 means that the server was unable to run correctlty your CGI script. What is the language used the script is written in (Perl, PHP, other?), is there an error log in the cgierror.log file? What operating system are you using? If the script is short, can you post it here for verification?

You can also search these forums for "error 500" to see what are the common solution to the common script problems resulting in such an error.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
empanad0
-


Joined: 31 Jul 2003
Posts: 6

PostPosted: Fri Aug 01, 2003 7:08 pm    Post subject: Reply with quote

#!c:/perl/bin/perl
use CGI::Carp qw(fatalsToBrowser);

use CGI;

$CGI::POST_MAX = 2048;

print "content-type: text/html\n\n";

binmode(STDIN);

@inx = <STDIN>;
@filetest = <STDIN>;

$str = @inx[1];
$str1 = reverse $str;
$filename1 = "";
$currchar = "";
$offset = 3;
while ($currchar !~ /\\/) {
$currchar = substr($str1, $offset, 1);
if ($currchar !~ /\\/) {
$filename1 = "$filename1$currchar";
$offset++;
}
}
$filename2 = reverse $filename1;

splice(@inx,0,4);
splice(@inx,$#inx,1);
$in = join("",@inx);
$in = substr($in,0,length($in) - 2);;
#
open(ff,">../$filename2");
binmode(ff);
print ff $in;
close(ff);

print "DONE, Uploaded Size: ".length($in)." bytes\n";
print "<br>View file at: <a href=\"24.193.135.36/$filename2\">$filename2</a>";


this is the code, its an upload script
_________________
(=
Back to top View user's profile Send private message AIM Address
empanad0
-


Joined: 31 Jul 2003
Posts: 6

PostPosted: Sat Aug 02, 2003 1:39 am    Post subject: Reply with quote

Nevermind, i know what it was!! Thanks, ur were a BIG help!
I got it working now (=
_________________
(=
Back to top View user's profile Send private message AIM Address
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat Aug 02, 2003 3:51 pm    Post subject: Reply with quote

empanad0 wrote:
Nevermind, i know what it was!! Thanks, ur were a BIG help!
I got it working now (=

Can you please tell us what was wrong?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
empanad0
-


Joined: 31 Jul 2003
Posts: 6

PostPosted: Tue Aug 05, 2003 4:16 am    Post subject: Reply with quote

My paths were all wrong, and I was using the wrong version perl interpreter
_________________
(=
Back to top View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group