[R] Can I run rscript with php?

Berend Hasselman bhh at xs4all.nl
Mon Dec 10 07:27:21 CET 2012


On 10-12-2012, at 00:04, DIMITRIS KARAKOSTIS wrote:

> 
> HiThanks for the answer.My actual problem is that I am trying to execute rscript through php by using the exec function.I am trying to execute a very simple Rscript by using PHP and the exec function.When I run the rscript through terminal (mac osx) then I get the output that I want (a plot).But when I use this php function:  exec("//usr//bin//Rscript /Applications/MAMP/htdocs/php_test/my_rscript.txt");I get nothing back. Please, do you have some idea what can it be wrong?


Could it be that you should change the // to single /?

exec("/usr/bin/Rscript /Applications/MAMP/htdocs/php_test/my_rscript.txt")

Berend

> I have already checked if the exec function is available in my php version. (it was)Also, I checked for the permissions of the rscript file..and they are fine. What else can it be?
> Thanks in advanceDimitris 
> 
> 
> 
> 
> From: dimitriskarakostis3 at hotmail.com
> To: r-help at r-project.org
> Subject: Where is located the rscript in mac osx??
> Date: Sun, 9 Dec 2012 21:36:55 +0200
> 
> 
> 
> 
> 
> 
> 
> Dear all,
> I have a very simple question. I am trying to find where islocated the rscript in mac os x. The r is installed in the applications folderbut I can not find the rscript.
> Thank you.Dimitris 		 	   		   		 	   		  
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list