Solved

I/O error within CGI script

Posted on 1998-10-26
3
189 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 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

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.

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…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

734 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