I am trying to capture my current window using ImageMagick using PHP script, but got error as response. I did searched for it in stackoverflow, but none of them solved my issue. I did installed imagemagick in my machine Ubuntu 14.04 . Following command gives me proper output.
import -window root screenshot.jpg
I have this in image.php
<?php
exec( "/usr/bin/convert rose: -resize 200x200 output.jpg");
exec( "/usr/bin/import -window root screenshot.jpg");
?>
<img src="output.jpg"/>
I have executed this from terminal
php image.php
And i got desired response(screen got captured and a file got created name screenshot.jpg)
Then i tried to access this above php script using my browser, The convert command works fine but for import comamnd nothing happens, i tried checking my apache log and it gives me following error
import: unable to open X server `' @ error/import.c/ImportImageCommand/368.
What am i missing here?
Is it a permission issue?