TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are using following code in .php script for generate .pdf file.

$result1 = exec("R CMD Sweave /var/www/html/r/r_latex_sweave.Rnw");

$result2 = exec("pdflatex /var/www/html/r/r_latex_sweave.tex");

but, we are getting this errors when we are executing .Rnw and .tex files.

! I can't write on file `r_latex_sweave.log'. Please type another transcript file name: ! Emergency stop ! ==> Fatal error occurred, no output PDF file produced!

Note: We have .tex and .Rnw folder in /var/www/html folder?

share|improve this question

closed as off-topic by Red, Kurt, Stefan Kottwitz Oct 10 '13 at 14:56

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center." – Red, Kurt, Stefan Kottwitz
If this question can be reworded to fit the rules in the help center, please edit the question.

sounds like there is a writelock on the file. Ensure that pdflatex if called from the shell works. After that see if the webserver has the proper permissions. Depending on your setup the file has to be owned by a special user under which the webserver runs, so the webserver may change it. Since this seems more like a server/programming question I suggest stackoverflow or superuser – ted Jul 30 '13 at 7:02
Delete r_latex_sweave.log file from directory. This file was builded by you as a user of the system, and php(_www user) have no permissions to rewrite it. – Ruben Kazumov Oct 28 '13 at 23:13

Browse other questions tagged or ask your own question.