PDA

View Full Version : 403 Forbidden Error


Ramesiv
03-23-2006, 12:32 AM
I've recently install ActiveState Perl on my computer and have configured by Apacehe httpd.conf (attqachment below) file to parse .pl files as .cgi files and my script is as follows:
#!d:/Perl/bin/perl.exe -w
use CGI;
$query = new CGI;
print $query->header;
print'<h1>Hello, World!</h1>';
However, when i try to view it on my server, i get a 403 Foribdden Error, as follows


Forbidden

You don't have permission to access /cgi/hello_world.pl on this server.
Apache/2.0.55 (Win32) PHP/5.1.2 Server at localhost Port 80

I'd really appreciate if anybod could help me sort this problem out. Thank you for reading.

FishMonger
03-23-2006, 01:58 AM
Where did you put your script? It should be in C:/Program Files/Apache Group/Apache2/cgi-bin/

What path are you using to call the script? If it's on your local system, call it like this:
http://localhost/cgi-bin/hello_world.pl

or

http://127.0.0.1/cgi-bin/hello_world.pl

You're missing a couple lines in the script.
#!d:/Perl/bin/perl.exe -w

use strict;
use CGI;

my $query = new CGI;

print $query->header;
print $query->start_html;
print '<h1>Hello, World!</h1>';
print $query->end_html;