davies has asked for the wisdom of the Perl Monks concerning the following question:
I have a SSCCE, DebugR.cgi:
#!c:/Strawberry/Perl/bin/perl use strict; use warnings; use Statistics::R; use CGI qw(:standard escapeHTML -utf8); print header(-type=>'text/html', -charset=>'utf-8'); my $R = Statistics::R->new(); print "R created\n"; $R->run('options(scipen = 999)'); # disabling scientific notation i +n R. print "R initialised\n";
Running this from the command line works as expected:
C:\Information\mgroot\cgi-bin>perl DebugR.cgi Content-Type: text/html; charset=utf-8 R created R initialised
But pointing a browser to it via an Apache web server results in only the "R created" line and the following errors in the log:
[Wed Jan 29 13:58:44 2020] [error] [client 192.168.1.207] ack Invalid +argument: write( 5, 'cmd<-c("write(ngettext(1, \\"Error: \\", \\"\\", + domain=\\"R\\"), stdout())"); write("\\1",stdout()) [Wed Jan 29 13:58:44 2020] [error] [client 192.168.1.207] ' ) at C:/St +rawberry/perl/vendor/lib/IPC/Run/IO.pm line 549. [Wed Jan 29 13:58:44 2020] [error] [client 192.168.1.207] Warning: una +ble to close filehandle GEN10 properly: Bad file descriptor during gl +obal destruction. [Wed Jan 29 13:58:44 2020] [error] [client 192.168.1.207] Warning: una +ble to close filehandle GEN5 properly: Bad file descriptor during glo +bal destruction.
It is not obvious to me why there should be a difference or where to start looking next. Any clues would be appreciated.
Regards,
John Davies
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Apache causing R to crash
by Fletch (Bishop) on Jan 29, 2020 at 15:18 UTC | |
by davies (Monsignor) on Jan 29, 2020 at 15:27 UTC | |
|
Re: Apache causing R to crash
by Anonymous Monk on Jan 30, 2020 at 00:58 UTC |