Solved

I/O error within CGI script

Posted on 1998-10-26
3
183 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
Comment Utility
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
Comment Utility
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
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to dynamically set the form action using jQuery.

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now