I am trying to take screenshot like this:
shell_exec("/usr/bin/wkhtmltoimage http://google.com screen.png");
But it is not creating screen.png. But when I run
/usr/bin/wkhtmltoimage http://google.com screen.png
from terminal it works as expected. I am confused what is wrong.
I tried to write log like:
shell_exec("/usr/bin/wkhtmltoimage http://google.com screen.png > debug.log 2>&1");
I get log "QXcbConnection: Could not connect to display Aborted (core dumped)" on debug.log. I have php7.0 installed with Nginx on Ubuntu. What would be the solution for this? Please share if someone solved the same.