I am trying to run an R script from PHP.
My PHP file looks like this:
exec("Rscript fig_lollipop.r");
And my R script looks like this:
library('RPostgreSQL')
#more goes code here...
I keep getting the following error:
Error in library("RPostgreSQL"):There is no package called 'RPostgreSQL'
I have attempted searching for common answers to this, and I think it might be related to the www-data user, but I'm really not sure. The R script works fine when running from the terminal.
Thanks in advance for any help! RC
.libPaths()for that session so that you know the web user can see the package? Do they have permissions to read those files?.libPaths()command in the terminal revealed an additional folder (where all the relevant packages are stored), as compared to.libPaths()from the web app. I copied the needed packages to a folder listed in.libPaths()from the web app, and now everything works. Thanks for the advice!