I have a simple command line here.. If I run it from a terminal it completes in about 1-2 sec, but if running it from php it never stops executing!? Why is that?
xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf /var/www/input.html /var/www/output.pdf
from php
exec('xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf /var/www/input.html /var/www/output.pdf');
with sudo
sudo -u www-data xvfb-run -a -s "-screen 0 640x480x16" /usr/bin/wkhtmltopdf /var/www/input.html /var/www/output.pdf
This doesn't create the output file but returns an error
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
Here both xcfb.err
and xvfb.out
are created but both files are empty. The command never completes executing
exec('xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf '.$path.'/email.html '.$path.'/output.pdf > '.$path.'/xvfb.out 2> '.$path.'/xvfb.err');