I want to compile a latex file via php. Therefore I use
shell_exec("/usr/bin/xelatex --output-directory=output/ --interaction batchmode doc.tex");
The problem I ran into is that the www-data user on my Apache webserver is not able to use some installed LaTeX packages. I believe (but I'm not sure) it has something to do with a home dir. And my www-data has none (or so I think).
By the way, I use TexLive on the server.
Edit: Here's my code of the php compiling
This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017/Debian) (preloaded format=xelatex 2018.6.16) 18 JUN 2018 07:13
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**/var/www/html/tennessee/wp-content/plugins/daw_songbook/tmp/doc.tex
(/var/www/html/tennessee/wp-content/plugins/daw_songbook/tmp/doc.tex
LaTeX2e <2017-04-15>
Babel <3.10> and hyphenation patterns for 8 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/book.cls
Document Class: book 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/bk10.clo
File: bk10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@chapter=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
! LaTeX Error: File `songs.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
! Emergency stop.
<read *>
l.5 \usepackage
{amsmath}^^M
*** (cannot \read from terminal in nonstop modes)
Here is how much of TeX's memory you used:
225 strings out of 494938
2641 string characters out of 6176411
55952 words of memory out of 5000000
4170 multiletter control sequences out of 15000+600000
3648 words of font info for 15 fonts, out of 8000000 for 9000
14 hyphenation exceptions out of 8191
22i,0n,19p,169b,40s stack positions out of 5000i,500n,10000p,200000b,80000s
No pages of output.
.logfile of the XeLaTeX run? – moewe Jun 18 '18 at 06:17songs? Are you sure you need it? – Johannes_B Jun 18 '18 at 06:58