Off topic:using PHP to execute Rscript in ubuntu apache server
0
0
Entering edit mode
6.2 years ago
xushutan ▴ 40

To build a website using PHP to execute Rscript. Errors like: there is no package called "XXX". This is probably due to the apache2 server can not access user installed R packages. Only packages installed in non-user directory /usr/local/lib/R/site-library, /usr/lib/R/site-library or /usr/lib/R/library is accessible to apache2. The solution is to change default package installation directory. Check default directory is R command: > .libPaths() . To change the default directory is by editing file /etc/R/Renviron and comment out R_LIBS_USER=${R_LIBS_USER-'~/R/x86_64-pc-linux-gnu-library/3.3'}. Now all new packages will be installed in /lusr/local/lib/R/site-library, which is accessbile to apach2 Rscript. Of course sudo permission is required when installing new packages.

software error Blog • 1.1k views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 2647 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6