Compiling latex into a pdf with PHP

I'm trying to get PHP to execute this command: /usr/bin/pdflatex --interaction batchmode $path.tex with shell_exec but getting an error from pdflatex:

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) restricted write18 enabled. entering extended mode ! I can't write on file 'tmp_1439479712.log'. (Press Enter to retry, or Control-D to exit; default file extension is'.log') Please type another transcript file name

I tried making a file with shell_exec("echo test > $path.test") and that worked so www-data can write files to the directory, I also tried running pdflatex in the cli as a user similar to www-data and that worked, what am I missing?

链接地址: http://www.djcxy.com/p/33426.html

上一篇: 编译从PHP的乳胶:“错误:无效的XRef流头”

下一篇: 使用PHP将latex编译为pdf