Is there any way of taking a screenshot of a website in PHP, then saving it to a file?
I set up finally using microweber/screen as proposed by @boksiora.
Initially when trying the mentioned link here what I got:
Please download this script from here https://github.com/microweber/screen
I'm on Linux. So if you want to run it, you may adjust my step follow to your environment.
Here are the step I did on my shell on DOCUMENT_ROOT
folder:
$ sudo wget https://github.com/microweber/screen/archive/master.zip
$ sudo unzip master.zip
$ sudo mv screen-master screen
$ sudo chmod +x screen/bin/phantomjs
$ sudo yum install fontconfig
$ sudo yum install freetype*
$ cd screen
$ sudo curl -sS https://getcomposer.org/installer | php
$ sudo php composer.phar update
$ cd ..
$ sudo chown -R apache screen
$ sudo chgrp -R www screen
$ sudo service httpd restart
Point your browser to screen/demo/shot.php?url=google.com
. When you see the screenshot, you are done. Discussion for more advance setting is available here and here.