I have a problem in writing data to a file using CGI. the code is as follows:
#!/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);
The above code is giving the following error: "Could not open the file for writing...Permission denied at /var/www/cgi-bin/wfile.cgi line 8. The read and write permission for the file is already set... Please help!!!
www-user
as well? The directory permissions too? – user1558455