develooper Front page | perl.beginners | Postings from October 2009

permissions problem with cgi scripting

Thread Next
From:
Myf White
Date:
October 10, 2009 09:08
Subject:
permissions problem with cgi scripting
Message ID:
14bb7600910100908v5608624bg841e578fb3bef3d8@mail.gmail.com
I've never done much in the way of cgi scripts before, and am just getting
started with it. I have encountered what seems to be a permissions problem,
which I can't work out how to solve. I'm hoping someone can help me.

I have a very simple test case:

#!/usr/bin/perl
use strict;
use warnings;
print "Content-type: text/html\n\n";
print "<html><head></head><body>\n";
open my $f, '>', 'test.txt' or print "$!\n";

When I run this script on the server: > test.cgi, the test.txt file is
created. However when I use a browser as a client to execute the script, it
prints the $! OS_ERROR "Permission denied" and the test.txt file is not
created.

The script has the permissions mask: '-rwxr-xr-x' and the directory has the
permissions mask 'drwxr-xr-x'.

Myf White
mailto:myfwhite@gmail.com

“Sometimes your joy is the source of your smile, but sometimes your smile
can be the source of your joy." Thich Nhat Hanh

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About