Executing wkhtmltoiamge from PHP hangs

asafpc

New Member
Executing wkhtmltoimage from PHP it just hangs.\[code\]$command = 'wkhtmltoimage --format "png" "' . $url . '" "' . $output . '"';exec($command);\[/code\]It hangs until PHP times out.I can run the same command from the CLI directly and it works fine.I have also tried:
  • adding \[code\]2>&1\[/code\] and \[code\]>nul 2>&1\[/code\].
  • using \[code\]shell_exec\[/code\] and backticks.
  • wrapping the exec in a batch file and calling \[code\]EXIT /B 0\[/code\]
I tried using Symfony Process instead and get this error:\[code\]Qt: Untested Windows version 6.2 detected!This application has requested the Runtime to terminate it in an unusual way.Please contact the application's support team for more information.terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc\[/code\]Running it from the CLI produces the same \[code\]Qt: Untested Windows version 6.2 detected!\[/code\] message, but the image is still generated. Running it from PHP just won't generate the image.Any idea how to make wkhtmltoimage work from PHP?
 
Back
Top