xvfb永远不会停止执行

时间:2015-11-27 20:18:16

标签: php xvfb

我这里有一个简单的命令行..如果我从一个终端运行它在大约1-2秒内完成它,但如果从php运行它它永远不会停止执行!?那是为什么?

xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf /var/www/input.html /var/www/output.pdf

来自php

exec('xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf /var/www/input.html /var/www/output.pdf');

使用sudo

sudo -u www-data xvfb-run -a -s "-screen 0 640x480x16" /usr/bin/wkhtmltopdf /var/www/input.html /var/www/output.pdf

这不会创建输出文件但会返回错误

Loading page (1/2)
Printing pages (2/2)
QPainter::begin(): Returned false
Done
Exit with code 1 due to network error: ProtocolUnknownError

pipe stdout / stderr

这里创建了xcfb.errxvfb.out,但这两个文件都是空的。该命令永远不会完成执行

exec('xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf '.$path.'/email.html '.$path.'/output.pdf > '.$path.'/xvfb.out 2> '.$path.'/xvfb.err');

0 个答案:

没有答案
相关问题