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

permissions problem with cgi scripting

Thread Next
Myf White
October 10, 2009 09:08
permissions problem with cgi scripting
Message ID:
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:

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

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

Myf White

“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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About