This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Blog: using PHP to execute Rscript in ubuntu apache server

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

Hello xushutan!

We believe that this post does not fit the main topic of this site.

This is a pure computer science question. Please search/ask StackOverflow

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

0 answers

No answers yet.

Log in to answer this question.