wkhtmltoimage permission issue-Collection of common programming errors
Problem: running wkhtmltoimage from a browser (localhost/run.php) fails (doesn’t finish, generates a crash report) when pulling some sites (http://tmz.com is one). It seems to be related to plugins (DirectorShockwave for instance). Most sites work just fine from the browser (if not –disable-javascript fixes them)
Environment: OSX 10.8, wkhtmltoimage 0.10.0 rc2, Chrome & Firefox
I’ve tried various combinations of settings (wkhtmltoimage –disable-plugins –load-error-handling ignore –disable-javascript http://www.tmz.com test4.png) and still get the same result.
However, if I run the same php script from terminal, it will work – the process finishes and the image is created and saved per the php script.
When I output posix_getuid() in each scenario, obviously there are different users: _www from the browser, my admin account from Terminal.
The crash report has this line “Exception Type: EXC_BAD_ACCESS (SIGBUS)” when running from the browser, so I assume it’s a permission issue. There is no crash report when run from Terminal.
What is the best approach to address this? Running the exec() statement as a different user? Letting _www initiate Flash? Something else?