Solved

I/O error within CGI script

Posted on 1998-10-26
3
185 Views
Last Modified: 2013-12-25
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
Comment
Question by:trinh
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
wisdom042597 earned 50 total points
ID: 1829295
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
 

Author Comment

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

Author Comment

by:trinh
ID: 1829297
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question