Compiling a latex document from PHP
This question already has an answer here:
This is running as part of a web page, presumably?
The problem is probably that your script is running as a different user. I expect it is running as apache
; and apache
might well not have the right path configured, or the right Latex setup for finding font directories and the like.
You haven't given much detail as to what system you're running on, but you could try running it as apache
to see if you can reproduce the error. If this is Linux, then become root, then go into the right directory, and run
su - apache pdflatex report.tex
to see what happens. To become root, you might be able to use su
on its own, if you know the root password; or if you're on Ubuntu, try
sudo bash
to become root (and give it your own password), and then the line I previously suggested to run as apache
.
上一篇: 使用PHP将latex编译为pdf
下一篇: 从PHP编译latex文档