I'm trying to execute firefox on a headless server to take screen shots of a website. I can do this fine from the terminal using
"DISPLAY=:12 firefox -saveimage http://www.google.com/".
The problem is when I try to do system("DISPLAY=:12 firefox -saveimage http://www.google.com"); doesn't work. I have a feeling that it's not executing in a normal shell environment. I went against my better judgment and gave the apache user an actual shell. If I su to apache and execute the command everything is fine and works as expected, but again it doesn't work from a system call. Any insight is very welcome.