Make latex fonts available for all users for a php compilation

I'm having problems with compiling a latex document using PHP shell_exec. I thought I had solved the problem, but alas I did not.

I have asked somthing similar before:

Compiling a latex document from PHP

And this answer led to me believe that the problem is simply the fact that the www-data user that executes the php scripts doesn't have access to the right font file.

It seemed that this page had the solution: How can I get PHP to compile a LaTeX document if it (www-data) can't get access to the required packages?

What I did is log as root, execute the command and it threw a bunch of text but no error was reported. Then I tried my webpage again, and the font not found error was still there.

Every time I try a compilation I get the error:

<inti.pdf, id=1, 533.995pt x 298.11375pt> <use inti.pdf> [1{/var/lib/texmf/font
s/map/pdftex/updmap/pdftex.map} <./inti.pdf>]
(./report.aux) )
!pdfTeX error: pdflatex (file ecrm1095): Font ecrm1095 at 600 not found

Don't know if the first part of the message is important or not so I copied it anyways (inti.pdf is a picture in the report.tex).

The missingfont.log file has this line:

mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 ecrm1095

How can I make the font be seen by the system. Maybe setting a environment variable? Or a Sudo command so that the font will permanently be seen by all users?


Ok, so I found a workaround/another clue to the problem. I'm only posting it here so it might help anyone else.

Firs of all, I was wrong. This is not a user permission issue. I changed my server username to my own and I still had the font not found problem.

However I was able to isolate the problem to one of the latex lines.

In particualar it started working correctly as soon as I commented:

usepackage[T1]{fontenc}

The line was inherited from a header I always use, but was not fundamental to the document and hence this managed to solve it.

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

上一篇: 将Rnw编译为tex时出错

下一篇: 使所有用户都可以使用乳胶字体进行php编译