Elliot Holden wrote:
> This is my script
> 
> open(OUTFILE, ">>", "survey.txt") or die "$!";
> 
>       I am runing this script through the webserver using a browswer,
> (action="http://localhost/pathtothecgiscript/cgiscript.cgi";) and the
> file, survey.txt, does NOT get created. When running from the command
> line the file DOES get created.
>       If I create the file in question, survey.txt, ahead of time and give
> it the permission 666, the webserver (Apache) can then write records
> to the file and the script runs with no problem.
>       Alot of people have been telling me that the webserver, in my case
> Apache, usually runs as a different user with different permissions
> than the user I am logged in as. But NO ONE can yet tell me how to
> give Apache or any webserver the right to create a file.

In order to create a new file, the user must have write permission in the
*directory* the file is to be created in. chmod 777 on the directory should
do the trick. Or, change the ownership of the directory to the Apache user
and chmod 755. Or, add the Apache user to the group that owns the directory
and chmod 775.

(P.S. "Alot" is not a word)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to