1

I've been looking for a solution to this for about a year, still haven't found one.

I'm trying to get a website snapshot script that I can host on my server and use freely that works well on 99% of webpages.

So far I've been using html2canvas but it doesn't really display images.

I looked into wkhtml2pdf before but I tried installing every single binary and executing from PHP. None of them worked!

All I know about my server is that it is Linux (so I only tested Linux static binaries). Even the basic --help command didn't work.

Please help me out. Thanks!

z--
  • 2,186
  • 17
  • 33
apparatix
  • 1,492
  • 7
  • 22
  • 37

2 Answers2

0

If you are using a hosting service, it is possible that it is impossible to execute binary programs stored in users' directories. (noexec flag on specific partition). You should first contact system administrator and ask if it is possible to put your own binary executables there. Perhaps, you can ask system administrator to install wkhtmltopdf for you in a global directory /usr/local/bin.

mateusza
  • 5,341
  • 2
  • 24
  • 20
  • Thanks for the quick reply! Although it's kinda demoralizing. Do you know of any other website screenshot scripts that I could use? – apparatix Jun 01 '12 at 11:22
  • 2
    It's not a screenshot script. Parsing HTML, CSS and putting it together is a very very complex job. In fact wkhtmltopdf is almost complete web browser, without clickable interface. – mateusza Jun 01 '12 at 11:28
0

You'll need more then a simple shared hosting, and more then "it is Linux". PHP could be in safemod and lots and lots of other limitations. I would choose a minimal VPS (like digitalocean or similar), root access, install wkhtml2pdf with dnf, yum or what's on you Linux distro, because it brings lots of dependencies to your machine. A minimal LAMP server should not have what's needed on it. You need to be able to allow Apache (or other user) to exec the binary.