Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI output problem.

Status
Not open for further replies.

JessicaC

Programmer
Jun 27, 2004
1
US
I am running a perl cgi script, in Redhat 6.2, with Apache as the
webserver. The script I am having trouble with has to write a
file, but instead of writing the contents it should, the file
contains only "/Xq987B:permission denied". I am running the script
as nobody. The file permissions are correct, and all other scripts
that do not output to a file run fine. (FYI, the file is supposed
to do a lynx capture and then output to the file). Any ideas???
ANY help would be appreciated.
 
' sounds, to me, like you are successfully writing to the file. Whatever you are doing to get your content from lynx is being denied. Look a little further upstream and make sure you are actually getting the content you want before it is written to disk.

HTH


keep the rudder amid ship and beware the odd typo
 
JessicaC

My guess is that you have a little bit of code like:

$theFile = "$ENV{PATH_TO_FILE}/Xq987B";
open( FILE, ">$theFile" );

Now, if $ENV{PATH_TO_FILE} hasn't been set, then this will try and open a file for writing in the / directory on your system. Most times, you will not be allowed to do this. Check that you aren't missing a directory string in front of your filename, or get root to temporarily give you permission to write to / for testing?

Hope this helps, Cheers NEIL :cool:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top