Solved

CGI-script file creation

Posted on 1997-06-18
1
150 Views
Last Modified: 2013-12-25
Is it abnormal for a CGI (PERL) script to be unable to create a new file?  

I am experiencing some trouble with my web server in that my cgi-scripts cannot write to files that do not already exist.  Even if the target file is in a directory with world read/write permissions.  

If this is abnormal, what should I say to my webmaster to try to solve the problem?
0
Comment
Question by:cprice
1 Comment
 

Accepted Solution

by:
david_z earned 30 total points
ID: 1828338
It obviously depends on exactly how you are trying to create these new files - it could just be an error in your Perl script that is making these files NOT be created. However, there are some reasons that would cause this to happen.

As you know, when you execute a CGI script, most often it is being executed as the user WEB. Now, because of the anonymous nature of the user WEB (there is no login needed) - many Unix Admins carefully administer the access that WEB has.

It is possible, on certain Unix flavors, to disallow write access to the user WEB regardless of the chmod settings given to a file or directory.

Perhaps you should check with your Web Master and make sure there are no such restrictions.

Also, just try a simple Perl write for your CGI script:

open (TEST, ">test");
print TEST "This is a test";
close(TEST);

and see if that works - because if it does - then it means you DO have write access - and your code is bad somehow.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
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…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…

829 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