I have connected the R and PHP in my local machine but i not able to do it in remote server
My php code is:
exec("Rscript exec_r.R $final_json_name",$opt_age_json1);
$str = $opt_age_json1[0];
$myobj = json_decode($str);
$final_r_filename = $myobj->first_name;
and My R code is :
library(jsonlite)
library(rjson)
args <- commandArgs(TRUE)
tmp <- strsplit(args, " ")
N <- args[1]
filename<-as.character(N)
file<-filename
mydf <- list(first_name = name)
cat(toJSON(mydf))
It works fine in my local machine but not in live server, in above code what am doing is,send the json file from php to R and process the file in R and send the json result to php
I am not included the full code here , if you help me to return the file name its fine for me.Can any body help me ? Thanks in advance.