I have a PHP script that compiles LaTeX documents with the use of:
exec('cd /path/to/doc && /usr/bin/latexmk -pdf filename.tex');
This is working for some of my LaTeX documents but my latest document doesn't compile and a look at the log reveals:
!pdfTeX error: pdflatex (file ecrm1000): Font ecrm1000 at 600 not found
==> Fatal error occurred, no output PDF file produced!
Which I have found is the result of LaTeX not being able to see the required font packages. When I run the same compile command under my username the document compiles as it should. So my question is, how can I get PHP (executing as www-data) to get access to the necessary LaTeX packages?
I have tried installing the required package under the www-data account using:
sudo -u www-data sudo apt-get install texlive-fonts-recommended
but it askes for www-data's password, which I don't believe was set by me and isn't anything I've thrown at it.
I'm running Ubuntu 12.04 if it's any help.
sudo mktexpk --destdir /usr/share/texmf-texlive/fonts/pk/ljfour/jknappen/ec/ --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 ecrm1000
... makes the font available for all users (same as in missingfont.log but with --destdir argument).
I run with similar problem and it was solved by setting $HOME
environment variable to /var/www
in a shell-script which invoked pdflatex
(or I believe any folder writeable to www-data
is ok here). See the details on TeX.SX.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With