?
Solved

CGI-script file creation

Posted on 1997-06-18
1
Medium Priority
?
160 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
[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
1 Comment
 

Accepted Solution

by:
david_z earned 90 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

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

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

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
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…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
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 …
Suggested Courses

762 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