Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

I/O error within CGI script

Posted on 1998-10-26
3
Medium Priority
?
195 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
wisdom042597 earned 150 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

650 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