I have written a php app that lets me store bookmarks on my server. Part of this is to capture a screenshot by opening firefox with Xvfb and using import to snag the screenshot. All of that is implemented in a Bash script and works wonderfully. On the PHP side I am simply calling that Bash script using exec, like so:
Code: Select all
# generate thumbnail image of website
exec("/usr/share/scripts/webshot.sh '$url' '$image.png'");
So, here's the problem.....if I were to execute that PHP file from the command line while su'd to www-data (apache user) it works wonderfully. But if I navigate to the same PHP script via a browser I get a screenshot of an empty "desktop".....which makes me think I have some permissions issue executing Firefox.
I've searched, and cannot find any log location to help me troubleshoot this. Any help that could be provided would be greatly appreciated.
Thanks