Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: CGI script cannot create file.

by Anonymous Monk
on Dec 18, 2012 at 08:37 UTC ( [id://1009311]=note: print w/replies, xml ) Need Help??


in reply to CGI script cannot create file.

My suspicion is

The great thing about computers is you don't have to suspect most of the time, you can know,

open ... or die Fudge("open($file)"); sub Fudge { use Errno(); join qq/\n/, "Error @_", map { " $_" } int( $! ) . q/ / . $!, int( $^E ) . q/ / . $^E, grep( { $!{$_} } keys %! ), q/ /; }

Replies are listed 'Best First'.
Re^2: CGI script cannot create file.
by Anonymous Monk on Dec 18, 2012 at 10:22 UTC
    Alright, heres what I get in the log file
    Problem with code: Error open(PAS, '>hf'), 13 Permission denied, 13 Pe +rmission denied, EACCES
    So it does look like a permission issue, Is there a way to resolve this? Preferably a way that doesn't require my user to do anything (all done with beautiful perl)?
      Well, you could run the following at the command prompt as your user, it does use Perl after all ;)
      perl -e ' $apache = qx(ps -ef | grep httpd); @fields=split /\s+/, $apa +che; exec ("chown $fields[0] /path/to/flat/file/directory");'
      However setting up a directory with write permission for the uid of the web service directly makes more sense from a certainty of action and security perspective

      print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1009311]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-24 22:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found