Solved

CGI-script file creation

Posted on 1997-06-18
1
141 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 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

17 Experts available now in Live!

Get 1:1 Help Now