0

I want catch web screenshots with PHP. Because I also need some process with PHP, I do not want use any on-line screenshot service. I am willing to renting a free hosting or a virtual server hosting which cost less than 20 dollars per year.

As I know, virtual server can not upload exe files (like url2bmp.exe, webshot.exe, webscreencapture.exe, etc). And they all use linux system (it can not use new COM("InternetExplorer.Application")).

So, is there any possible cacth a web screenshot in virtual server with PHP? Thanks.

cj333
  • 2,547
  • 20
  • 67
  • 110

3 Answers3

1

as a possible alternative, you can check out this project: http://code.google.com/p/wkhtmltopdf/

Zathrus Writer
  • 4,311
  • 5
  • 27
  • 50
0

You can take automated screenshots of websites using an open-source tool like pageres. It can also simulate various resolutions, testing responsive layouts.

I'm not sure whether it's relevant that your website is coded in PHP, or that you're mentioning .exe files. Are you new to web development?

Dan Dascalescu
  • 143,271
  • 52
  • 317
  • 404
0

You can do this with Linux, it is seriously tricky though. You need FireFox, imagmagik and VNC installed.

Basically you get Firefox to open a new window in a VNC display, grab the screenshot of that display with imagmagik and then save it as a thumbnail. The hard part about this is getting the VNC portion to work, especially with a headless setup. But it is completely do-able.

However, it will probably be a ton easier just getting a Windows VPS.

Doing a search, found this which might work:

Taking website screenshot, server-side, on a Linux rented server, free

Ah and here is the post about what I described above:

Command line program to create website screenshots (on Linux)

Community
  • 1
  • 1
Jim
  • 18,673
  • 5
  • 49
  • 65
  • This answer seems quite outdated. [If I understand the question correct, the user wants an automated screenshot taking tool.](http://stackoverflow.com/a/27210755/1269037) – Dan Dascalescu Nov 30 '14 at 06:41
  • Right but the OP stated they did not want to use an online screenshot taking tool. So given the requirement pageres, aside from being an awesome tool, didn't meet their criteria. – Jim Mar 30 '15 at 19:38