0

When running a R function I created with Rscript command in ubuntu terminal (after su to Apache server www-data user) I get perfect results (function code not inserted due to length). However, when running the same function via php exec("Rscript wrapper.R $N)" on Apache I get absolutely nothing.

Note that other R functions I tried (like rnorm) work just fine.

Is there some difference between the terminal run (again, in www-data user so permissions should not be a problem) and the php exec that I am not aware of? What could be the source of such differences in results?

Guest3290
  • 167
  • 9
  • Just a guess, but I would first check how/what you are returning. Can you post the last few lines of your `R` function – Ricardo Saporta Jan 10 '14 at 17:18
  • Try inserting something like `write(x=3, file="test.txt")` right before the end of your `R` function and see if the `test.txt` file is created. If so, then you know the function is executing and you simply need to check how you are returning the expected output – Ricardo Saporta Jan 10 '14 at 17:19

0 Answers0