So my problem is the following: I have an R markdown file on my Ubuntu 18.04.3 server that I want to be knitted via command line (this works fine with Rscript -e "rmarkdown::render('path/to/file.Rmd')"), so I tried to run this from PHP with the exec() command (obviously using escape characters). The output from PHP is the following:
Execution haltedArray ( [0] => Error: unexpected input in "rmarkdown::render(\" [1] => Execution halted )
when running the following lines of PHP:
exec("Rscript -e \"rmarkdown::render(\'path/to/file.Rmd\')\" 2>&1", $output);
print_r($output);
What is the unexpected input?