I am trying to build a php file that allows users to run a R script so they don't need to open a session in the server, just to open a browser.
Usual bash from the script run fine (say echo "something", copy and move data files,...) but R script is not running. R is called with Rscript
Rscript --no-save --no-restore --verbose ./RAMS-mapa-onades-zones-manual.R > outputFile.Rout 2>&1
R output gives this error
running
'/usr/lib/R/bin/R --slave --no-restore --no-save --no-restore'
Error in library("rgdal") : there is no package called 'rgdal'
Execution halted
Well, library(rgdal) is the first line of the R script. Rgdal is present on the R installation and the script runs fine (Rscript myscript.R) from the command line.
As starting from php, the user running R is www-data while on the terminal the user is meteo. It seems to me that some environment variable needs to be set in the php Rscript execution but I can't find the way to do it.
Any idea? Thanks in advance
lib.locparameter onlibrary()as well.library()reports packages in/home/meteo/R/i686-pc-linux-gnu-library/3.1,/usr/local/lib/R/site-libraryand/usr/lib/R/libraryand a warningIn library() : library ‘/usr/lib/R/site-library’ contains no packages