0

We tried out to execute the following commands from php script to take print screen in Ubuntu, but it's not working. These commands are working properly in terminal but not through php script. Please give a solution to this..

shell_exec('gnome-screenshot -d 10');

shell_exec('import -window root image.jpg');

exec('gnome-screenshot -d 10');

exec('import -window root image.jpg');

4
  • 1
    Possible duplicate of Convert HTML to Image in PHP without shell Commented Nov 26, 2015 at 11:28
  • This would be an alternative way to do what the asked asked, but however the asker is looking to find out with exec and shell_exec will not work. Commented Nov 26, 2015 at 11:29
  • @Stah Please see meta.stackexchange.com/q/66377/147640 Commented Nov 26, 2015 at 11:30
  • Actually I am looking for the command which is properly run through php script and save the image in my destination path. imagegrabscreen(); work only in window but not in ubuntu Commented Nov 26, 2015 at 11:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.