陆零云
16
0
合同 PDF 在测试环境中文正常,上线后甲方名字全是问号。日志里有一条 Dompdf\Exception: Unable to create the font cache directory,被 catch 之后只打了行 warning,页面照常输出。
第一反应是字体文件没带上去。把 NotoSansSC-Regular.otf 放进 storage/fonts,setDefaultFont 也改成了 NotoSansSC,问号没变。
再看异常。Dompd...
陆零云
26
0
合同导出从 30 页涨到 200 页,接口 504,Nginx 日志 upstream timed out 60s。Dompdf 0.8.6,memory_limit 512M,报错里没有内存,只有 Maximum execution time of 60 seconds exceeded。
我先 set_time_limit(0),再把 memory_limit 调到 1G。任务能跑完,但要 140 秒,前端早就断了,队列里的 worker 也被占死。...