【发布时间】:2013-12-29 05:26:44
【问题描述】:
我在使用 CGI 将数据写入文件时遇到问题。代码如下:
#!/usr/bin/perl
use strict;
use warnings;
use CGI ":standard";
print "Content-type:text/html \n\n";
open (FILE, '>', "file.txt") or die ("Could not open the file for writing...$!");
print FILE "something";
close(FILE);
上面的代码给出了以下错误: “无法打开文件进行写入.../var/www/cgi-bin/wfile.cgi 第 8 行的权限被拒绝。 文件的读写权限已经设置...请帮忙!!!
【问题讨论】:
-
也适用于
www-user?目录权限也是? -
"文件的读写权限已经设置" — 什么? Web 服务器以什么用户身份运行脚本?
标签: perl