[tex-k] kpathsea and compilation by a web server

mario chiari ml at mariochiari.net
Thu Feb 27 19:00:18 CET 2014


Hi

my first post on this list.  I hope it is the proper forum to ask help
for my problem.

I have been a LaTeX user for some time, but with a very basic knowledge
on how it works.

On my local web server Apache (Linux platform), I create and compile a
number of .tex file calling some php script from a web client. This has
been working without main issues. 

For a recent job, I need to output some cyrillic text. I am able to do
so, if a compile a myfile.tex file from my shell (or from within an
editor as Kile) as the root user.
However, if a call from a web client a php script with instructions

`/usr/local/texlive/2013/bin/i386-linux/latex  --interaction batchmode
myfile.tex`;

compilation partially fails, in particular cyrillic letters are not
rendered. 

I have tried to execute my php script from a shell as the apache user,
and I got the following error
............
LaTeX Font Warning: Font shape `T2A/wncyr/m/n' undefined
(Font)              using `T2A/cmr/m/n' instead on input line 2.

kpathsea: Running mktextfm larm1728
mkdir: cannot create directory `././var/www/.texlive2013': Permission
denied
mktextfm: mktexdir /var/www/.texlive2013/texmf-var/fonts/tfm/lh/lh-t2a
failed.
kpathsea: Appending font creation commands to missfont.log.
! Font T2A/cmr/m/n/17.28=larm1728 at 17.28pt not loadable: Metric (TFM)
************** 

However, by setting

chown apache:apache /var/www/

i get instead
******************
LaTeX Font Warning: Font shape `T2A/wncyr/m/n' undefined
(Font)              using `T2A/cmr/m/n' instead on input line 2.
kpathsea: Running mktextfm larm1728
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1;
nonstopmode; input larm1728
This is METAFONT, Version 2.718281 (TeX Live 2013)
kpathsea: Running mktexmf larm1728
mktexmf: /var/www/.texlive2013/texmf-var/fonts/source/lh/lh-t2a/larm1728.mf: successfully generated.
--snip--
*******************
and eventually I get a fine output. 

The bad news is that is not good enough, compilation still fails if I
call the same php script from my web client. 

What I note is that mktexmf creates larm1728.mf within /var/www/, where
instead my DocumentRoot is /var/www/html/ (i can not chenge that) 

I suspect the/a issue is
that .texlive2013/texmf-var/fonts/source/lh/lh-t2a/larm1728.mf should be
somewhere else within my DocumentRoot, as to be available to the web
server. 

However, I do not see where exactly and how to force mktexmf to create
it there.
I appreciate your advise.

mario







More information about the tex-k mailing list