0

I am running the php script containing Rscript in terminal. its working fine and giving the output. but the same script if i call from the webpage its not giving any output. i have checked the folder permission also. please help me to fix this.

my php script:

<?php
$abc=exec('Rscript dist/GS_R2html.R');
print "$abc\n";
?>

Rscript:

a<-rnorm(1000)
library(R2HTML)
setwd('/var/www/test')
HTML.title("Data Summary", file="dist/gshtml.htm",append=F)
HTML(summary(a),file="dist/gshtml.htm",align="left")
HTML(matrix(a[1:100],nrow=10,byrow=T),file="dist/gshtml.htm",align="left")
HTML.title("Histogram", file="dist/gshtml.htm") 
jpeg("dist/plot2.jpg")
hist(a,col="red")
HTMLInsertGraph("dist/plot2.jpg",file="dist/gshtml.htm",Align="left")   
dev.off()
Dadu
  • 89
  • 3
  • 14

1 Answers1

0

Its due to the missing of the rApache which supports web application development using the R and the Apache web server. I followed the steps mentioned in the http://rapache.net/manual.html to install and configure R in Apache.

Dadu
  • 89
  • 3
  • 14