latex compilation via php's shell_exec

General Tech Bugs & Fixes 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

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 belive (but I'm not sure), it has something to do with a home dir. And my www-data has none (so do I think).

By the way, I use texlive on the server.

I hope you can help me, thanks for that!

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  to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
 

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.

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community