提问人:Simon 提问时间:10/16/2023 最后编辑:Simon 更新时间:10/16/2023 访问量:44
无法使用 lualatex 作为 www-data 进行正确编译
Can't compile properly with lualatex as www-data
问:
我有一个网络应用程序,我希望能够在其中编译 .tex 文档。
我已经通过执行 .
我的问题是,当我尝试使用 www-data 用户编译 .tex 时,我得到了我的 .tex 的这种日志。sudo apt-get install texlive-full
This is LuaHBTeX, Version 1.15.0 (TeX Live 2022/Debian) (format=lualatex 2023.9.5) 15 OCT 2023 18:20
restricted system commands enabled.
**templateMiseEnPage04bf8b50-b5b5-49c6-bcb7-c6b4523bfebc3.tex
(./templateMiseEnPage04bf8b50-b5b5-49c6-bcb7-c6b4523bfebc3.tex
LaTeX2e <2022-11-01> patch level 1
Lua module: luaotfload 2022-10-03 3.23 Lua based OpenType font support
Lua module: lualibs 2022-10-04 2.75 ConTeXt Lua standard libraries....e/texmf-di
st/tex/luatex/lualibs/lualibs-basic-merged.lua:4145: bad argument #1 to 'find' (
string expected, got nil)
stack traceback:
[C]: in function 'string.find'
...e/texmf-dist/tex/luatex/lualibs/lualibs-basic-merged.lua:4145: in main chunk
[C]: in function 'dofile'
.../share/texlive/texmf-dist/tex/luatex/lualibs/lualibs.lua:96: in local 'loadm
odule'
.../texlive/texmf-dist/tex/luatex/lualibs/lualibs-basic.lua:44: in main chunk
[C]: in function 'dofile'
.../share/texlive/texmf-dist/tex/luatex/lualibs/lualibs.lua:96: in local 'loadm
odule'
.../share/texlive/texmf-dist/tex/luatex/lualibs/lualibs.lua:106: in main chunk
[C]: in function 'require'
...ive/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua:224: in upvalue 'in
it_main'
...ive/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua:590: in function 'l
uaotfload-init.lua'
.../texlive/texmf-dist/tex/luatex/luaotfload/luaotfload.lua:322: in field 'main
'
[\directlua]:1: in main chunk.
<everyjob> ...ring \\def\string \\encodingdefault{OT1}')end }
\let \f@encoding \encoding...
l.1
\documentclass[12pt, a4paper]{article}
The lua interpreter ran into a problem, so the
remainder of this lua chunk will be ignored.
L3 programming layer <2023-01-16>
Inserting `tracingstacklevels' in `input_level_string'. (/usr/share/texlive/tex
mf-dist/tex/latex/base/article.cls
Document Class: article 2022/07/02 v1.4n Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo
File: size12.clo 2022/07/02 v1.4n Standard LaTeX file (size option)
! Font \TU/lmr/m/n/12=[lmroman12-regular]:+tlig; at 12pt not loadable: metric da
ta not found or bad.
<to be read again>
relax
l.54 \normalsize
当我在做一个 Laravel 项目时,我尝试了我在这里找到的东西 https://tex.stackexchange.com/questions/480119/lualatex-doesn't-run-when-under-www-data 使用 Process 语法:
$process = new Process(['/usr/bin/lualatex', '-interaction=nonstopmode', $texFile]);
$process->setEnv(['TEXMFCACHE' => ':/tmp/']);
try {
$process->mustRun();
echo $process->getOutput();
} catch (ProcessFailedException $exception) {
echo $exception->getMessage();
}
为了直接从应用程序编译 .tex,但我收到相同的日志消息。
我想第一件事是设法在VM中手动将.tex编译为www-data。
当我以 root 身份在 VM 上运行 .tex 时,一切正常。
答: 暂无答案
评论
.tex