exec("wkhtmltopdf test.html output.pdf");
In the php command line it works but if I try to call it from apache it doesn’t create the pdf file and the log show this:
$ tail -f /var/log/apache2/error.log
wkhtmltopdf: cannot connect to X server
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use Xvfb to emulate a x-environment
OR
I made this script for myself to get wkhtml running on centos 6+:
After that run it in PHP: