On Sat, Aug 11, 2018 at 07:58:02PM +0200, Toru Okada wrote:
> I want to write a file out from within a perl cgi script. This is obviously
> not possible in the standard configuration of httpd. The normal output works
> perfectly. What is to do?
> print("Content-Type: text/html; charset=ascii\n\n");
Unrelated but the line-endings should be "\r\n" for these headers.
> print("hello world"); # works
> # no error but not found in file system after the script finished
> open(my $fh, ">", "out") or die $!;
Maybe some permission/work directory issue? Try writing to an absolute path.
slowcgi is chrooted by default, so maybe it tries to write to /var/www/out and
it has no permissions for that?
Running httpd -d -vv and slowcgi -d can help to debug too.
> print($fh "foo");
> OpenBSD 6.1
> Many thanks in advance.