Problems with wkhtmltopdf using VPS Centos Linux

  • Answered
The issue is that I have more than 1 week trying to figure out this:

1.- I did installed correct wkhtmltopdf in my linux vps, using in Command Line works very good example:
/usr/local/bin/wkhtmltopdf -s A4 -B 1 -T 1 -L 1 -R 1 ../file.pdf
Works good!!!

2.- The problem is When I try to do run the same command line using php files.

try {
$resultado=shell_exec("/usr/local/bin/wkhtmltopdf -s A4 -B 1 -T 1 -L 1 -R 1 ../file.pdf > ../debug.log 2>&1");

} catch (Exception $e) {
echo 'Excepcion capturada: ', $e->getMessage(), "\n";


It seems that the problem is related to permissions php cpanel or something.
What is your recommendation?

There are many people with the same problem

Hello, Thank you for your contacting us about an issue running wkhtmltopdf from command line. I recommend turning on error reporting, which should provide more specific clues into what is happening. Let us know if you get any additional error messages. If you have any further questions, feel free to post them below. Thank you, John-Paul