cj333
cj333

Reputation: 2609

Is there any possible cacth a web screenshot in virtual server hosting with PHP?

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.

Upvotes: 0

Views: 469

Answers (3)

Dan Dascalescu
Dan Dascalescu

Reputation: 152125

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?

Upvotes: 0

Zathrus Writer
Zathrus Writer

Reputation: 4331

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

Upvotes: 1

Jim
Jim

Reputation: 18853

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)

Upvotes: 0

Related Questions