我为此付出了很多努力。我有2个RH7盒,刚刚安装了httpd24(v2.4.34)。他们正在运行httpd(v2.4.6),没有任何连接问题。现在,当我尝试从浏览器运行Perl脚本时,它们会失败并显示...
var jsPDF = require('./pdf/jspdf.min.js');
var html2canvas = require('./pdf/html2canvas.min.js');
el.onclick = function(e) {
const filename = 'export.pdf';
html2canvas(
document.querySelector('.element'),
).then(function(canvas) {
console.log(canvas);
let pdf = new jsPDF('p', 'mm', 'a4');
pdf.addImage(
canvas.toDataURL('image/png'),
'PNG',
0,
0,
211,
298,
);
pdf.save(filename);
});
}
但是当我从命令行运行相同的脚本时,如“ apache”,它运行得很好。所有ENV变量均已正确设置。
有人碰到过类似的东西吗?
答案 0 :(得分:0)
它将不再使用我在httpd.conf中设置的LD_LIBRARY_PATH环境变量。
服务在不影响用户环境(例如环境变量值)的全新环境中启动。结果,在服务启动期间,所有启用的集合的信息都会丢失。
较新版本的httpd已停止在启动服务时将用户环境引入。我在/ opt / rh / httpd24 / service-environment中发现了这个小问题。
grep -r "LD_LIBRARY_PATH" /opt/rh/httpd24/
/opt/rh/httpd24/enable:export LD_LIBRARY_PATH=/opt/rh/httpd24/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
我在/ opt / rh / httpd24 / enable中添加了标准的notifyix路径。
export LD_LIBRARY_PATH=/opt/IBM/informix/lib:/opt/IBM/informix/lib/esql:/opt/rh/httpd24/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
一切恢复正常。哇!