• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

I/O error within CGI script

I have a CGI script that open a file and write some
values to a file. This works OK on WinNT server. But
it stop working on Apache Server 1.3.1 on Unix.
Anyone has an idea ? Is this related to Apache config ?
It fails when I try to do fprintf(fp,"my value"). Of course,
I open the file (fp=fopen("myfile","w")). I get an error
log from Apache indicating Premature end of script headers.
0
trinh
Asked:
trinh
  • 2
1 Solution
 
wisdom042597Commented:
This means that your script is crashing under Unix.  In all likelihood (since it's difficult to guess without having more debug information), I'd suggest you're running into a permissions problem.  You're probably trying to update a file that under Unix isn't assigned write priviledges for the user attempting the update (in this case, the web server).

Check to make sure the web server user either has ownership of the directory or file you're trying to write to, or make the file and/or directory (if the file doesn't originally exist) read and writeable by "other" and "group", in addition to it's owner.

0
 
trinhAuthor Commented:
Yes, I check the cgi-bin directory, it has only read permission.
I change to add "Write" permission and it works fine, thanks
0
 
trinhAuthor Commented:
Yes, I check the cgi-bin directory, it has only read permission.
I change to add "Write" permission and it works fine, thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now