Is there any way of taking a screenshot of a website in PHP, then saving it to a file?
It's in Python, but going over the documentation and code you can see exactly how this is done. If you can run python, then it's a ready-made solution for you:
http://browsershots.org/
Note that everything can run on one machine for one platform, or one machine with virtual machines running the other platforms.
Free, open source, scroll to bottom of page for links to documentation, source code, and other information.