Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: opening a file using CGI

by sk (Curate)
on Jan 04, 2006 at 03:26 UTC ( #520788=note: print w/ replies, xml ) Need Help??


in reply to opening a file using CGI

As mentioned by ptum the problem is likely due to file perm. I did this on my machine (Apache 2.0/Mod_perl) -

#!/usr/bin/perl -wT use strict; use CGI; use CGI::Carp qw/fatalsToBrowser/; open (OUT, ">/no/perm/path/junkfile") or die $!; print OUT ("hi there\n"); close(OUT);

I get this -

Software error: Permission denied at /var/www/html/perl/create.cgi line 7. For help, please send mail to the webmaster (root@localhost), giving t +his error message and the time and date of the error.

However when i changed the path to /tmp/junkfile (world-writeable for me) it works just fine. I guess if you turn on the fatalsToBrowser (turn it off for production) you will get more info. Also take a look at your apache logs!

cheers

SK


Comment on Re: opening a file using CGI
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2015-07-03 21:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (56 votes), past polls