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
In reply to Apache causing R to crash by davies
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |