Question

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.

Was it helpful?

Solution

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)

OTHER TIPS

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

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top