# Execute lualatex within bash script placed inside cgi-bin [closed]

have a cgi-script which generates a *.tex file based on inputs from the browser. i would like to generate a pdf and download it.

however the command doesnt execute and i get a fail message

if lualatex -interaction batchmode 3.tex
then
echo"yo"
else
echo "fail"
exit 2
fi


the 3.tex file is perfect and lualtex executes when directly executed from terminal.

i have used this also but could get it too work

kindly help

## closed as off-topic by Martin Schröder, Ronny, Zarko, Mensch, egregOct 22 '16 at 21:46

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center." – Martin Schröder, Ronny, Zarko, Mensch, egreg
If this question can be reworded to fit the rules in the help center, please edit the question.

• is luatex in the PATH available in your cgi-bin environment? – David Carlisle Oct 22 '16 at 19:02
• found it not present – user1869714 Oct 22 '16 at 19:08
• stick echo $PATH and type luaflatex into the script and see what comes out, or simply use luatex by its full path /usr/local/texlive/20..../bin/lualatex or whatever is allowed in your cgi environment, if the web server runs off a virtual root is tex even installed? – David Carlisle Oct 22 '16 at 19:10 • thank you sir, it started working after adding the full path. could you please guide as to how to add it to the PATH available in your cgi-bin environment – user1869714 Oct 22 '16 at 19:18 • just put export PATH=/usr/local./txliv/whevere/it/is:$PATH as teh first line to add the texlive bin to the path – David Carlisle Oct 22 '16 at 20:44

/usr/local/texlive/2016/bin/whatever/lualatex 3.tex

export PATH=/usr/local/texlive/2016/bin/whatever:\$PATH